summaryrefslogtreecommitdiff
path: root/programs/subeditor.s
diff options
context:
space:
mode:
Diffstat (limited to 'programs/subeditor.s')
-rw-r--r--programs/subeditor.s20
1 files changed, 7 insertions, 13 deletions
diff --git a/programs/subeditor.s b/programs/subeditor.s
index 26c6f7d..1768d62 100644
--- a/programs/subeditor.s
+++ b/programs/subeditor.s
@@ -1058,8 +1058,10 @@ update_pos:
adc scr_str ; with the starting line number to get the absolute line number.
tay ; Place it in the Y regster for now.
mul #maxcol+1 ; Multiply the line number by the screen's max column count, plus 1.
+ clc ; Clear the carry flag.
adc scr_col ; Add the cursor's column number to get the screen index.
tay ; Place the index into the Y register.
+ tba ; Reset A.
lda #$1B ; Print an escape character
sta scr ; to the screen.
lda #'[' ; Print '['
@@ -1072,27 +1074,19 @@ update_pos:
getrow:
lda scr_row ; Get the cursor's y coordinate.
- div #10 ; Divide A by 10.
- adc #'0' ; Convert it to ascii, and
- sta scr ; print to the screen.
- tba ; Get the remainder.
- adc #'0' ; Convert it to ascii, and
- sta scr ; print to the screen.
- rts ; End of getrow.
-
+ jmp bcd ; Convert it to BCD.
getcol:
lda #';' ; Print ';'
sta scr ; to the screen.
lda scr_col ; Get the cursor's x coordinate.
+bcd:
div #10 ; Divide A by 10.
- clc ;
- adc #'0' ; Convert it to ascii, and
+ ora #'0' ; Convert it to ascii, and
sta scr ; print to the screen.
tba ; Get the remainder.
- clc
- adc #'0' ; Convert it to ascii, and
+ ora #'0' ; Convert it to ascii, and
sta scr ; print to the screen.
- rts ; End of getrow.
+ rts ; End of bcd.
scrl_down:
inc scr_str ; Increment the starting line of the screen.