Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SteveOS16
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephen D
SteveOS16
Commits
ff79c9ad
Commit
ff79c9ad
authored
6 years ago
by
Stephen D
Browse files
Options
Downloads
Patches
Plain Diff
text editor additions
parent
15c8f344
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
textedit.asm
+23
-3
23 additions, 3 deletions
textedit.asm
with
23 additions
and
3 deletions
textedit.asm
+
23
−
3
View file @
ff79c9ad
;; Steve16 text editor
%define SEDIT_EDITOR_BUFFER 0x8000
;Store the text buffer here for now
sedit_init:
pusha
...
...
@@ -13,6 +12,26 @@ sedit_loop:
int
0x16
;Read kb
cmp
al
,
0x1B
;Esc pressed
je
sedit_exit
;; Compare with other special characters
cmp
al
,
' '
jl
sedit_loop
;al is less than space
cmp
al
,
0x7F
jg
sedit_loop
;al is greater than ~
;; At this point, we know it's a regular character
mov
bx
,
SEDIT_EDITOR_BUFFER
add
bx
,
[
SEDIT_CURSOR_POSITION
]
mov
[
bx
],
al
;Append character to text buffer
call
print_char
;pretty temporary
;; Increment cursor position
add
[
SEDIT_CURSOR_POSITION
],
byte
1
jmp
sedit_loop
...
...
@@ -25,7 +44,8 @@ sedit_exit:
ret
;; Varibles
SEDIT_CURSOR_POSITION:
d
b
0
SEDIT_CURSOR_POSITION:
d
w
0
;; Messages
SEDIT_INIT_MSG:
db
"Steve16 Text Editor"
,
0xD
,
0xA
,
0
;; SHORTENED to save space
SEDIT_INIT_MSG:
db
"Steve16 TE"
,
0xD
,
0xA
,
0
SEDIT_EXIT_MSG:
db
"Goodbye!"
,
0xD
,
0xA
,
0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment