diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2020-06-11 21:39:59 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2020-06-11 22:05:03 -0400 |
commit | 460832c13c9d476d71e626a0c42de4eeff3feb63 (patch) | |
tree | b3e5ea55f704d7e1672504eca8e99ffabe9c558a /programs/subeditor.s | |
parent | 0bc02d48d100aff63e40132786a89123ac43ae48 (diff) |
Did some more stuff.
- Fix some bugs with strings.
- Started to refactor the instruction functions.
- Added support for using RS prefixes on the memory
based increment, and decrement instructions.
- Started work on SuBAsm's lexer.
Have fun looking at this, BieHDC. :)
Diffstat (limited to 'programs/subeditor.s')
-rw-r--r-- | programs/subeditor.s | 20 |
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. |