summaryrefslogtreecommitdiff
path: root/programs/sub-suite/subasm.s
diff options
context:
space:
mode:
Diffstat (limited to 'programs/sub-suite/subasm.s')
-rw-r--r--programs/sub-suite/subasm.s12
1 files changed, 8 insertions, 4 deletions
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.