From 35a18609864470b3dc49f3a9a6cb6ec93e57300d Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Thu, 25 Feb 2021 12:43:11 -0500 Subject: - Implemented the multiply expression into the assembler. - Implemented support for the SIB addressing mode into the assembler. SIB is short for "Scale Index, and Base", and works much like x86's version of SIB (scale*index+base), although my version supports any scale value between 1, and 256. - Redid the line shifting routine in SuBEditor. It now uses memcpy, and memset to do that, and also supports shifting the line left, or right by any number of characters. --- programs/sub-suite/subasm.s | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'programs/sub-suite/subasm.s') diff --git a/programs/sub-suite/subasm.s b/programs/sub-suite/subasm.s index f22ee60..56d13c2 100644 --- a/programs/sub-suite/subasm.s +++ b/programs/sub-suite/subasm.s @@ -118,7 +118,6 @@ subasm: pha.q ; Preserve A. - phe.q ; Preserve E. des ; Make room for the command id. and #0 ; Reset A. lea d, (cmd_buf) ; Get the command buffer. @@ -128,23 +127,28 @@ subasm: jsr chk_cmd ; No, but did we get a full command? bne @cmd ; Yes, so skip everything else. mov.q ptr, d ; + psh d ; Preserve D. + psh s ; Preserve S. + psh f ; Preserve F. jsr lex ; No, so start lexing this line. + pul d ; Restore D. + pul s ; Restore S. + pul f ; Restore F. bra @end ; We are done. @cmd: mov s, (s) ; Get the command ID. cmp s, #7 ; Is the command ID greater than the command count? bcs @end ; Yes, so we're done. lsl s, #1 ; No, so multiply the command ID by two. - lea.w e, (cmd_srt+s) ; Get the pointer, from the command subroutine table. + lea.w s, (cmd_srt+s) ; Get the pointer, from the command subroutine table. and #0 ; Reset A. tab ; Reset B. - jsr (e) ; Run the command's subroutine. + jsr s ; Run the command's subroutine. @end: and #0 ; Reset A. jsr update_ptr ; Get the screen buffer index. tay ; Save it in Y. ins ; Cleanup the stack frame. - ple.q ; Restore E. pla.q ; Restore A. rts ; End of subasm. -- cgit v1.2.3-13-gbd6f