From 460832c13c9d476d71e626a0c42de4eeff3feb63 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Thu, 11 Jun 2020 21:39:59 -0400 Subject: 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. :) --- programs/subeditor.s | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'programs/subeditor.s') 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. -- cgit v1.2.3-13-gbd6f