Skip to content

Commit 21fa21a

Browse files
committed
Use PRINT_ARG for passing argument to RTAB.
1 parent 3767aba commit 21fa21a

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/interp/atari/print_tab.asm

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
sbc COLCRS
4040
bcs ok
4141
rep:
42-
adc tmp2
42+
adc PRINT_ARG
4343
bcc rep
4444

4545
ok:
@@ -52,7 +52,7 @@ ok:
5252
.endproc
5353

5454
.proc EXE_PRINT_TAB ; PRINT TAB up to column N
55-
sta tmp2
55+
sta PRINT_ARG
5656
jsr do_tab
5757
jmp next_instruction
5858
.endproc
@@ -61,16 +61,13 @@ ok:
6161
sta tmp1 ; Save AX (string address)
6262
stx tmp1+1
6363

64-
lda stack_l, y ; Get TAB position
65-
sta tmp2
66-
6764
ldy #0
6865
sec
66+
lda PRINT_ARG ; Get TAB position
6967
sbc (tmp1), y ; subtract string length
7068

7169
jsr do_tab
7270

73-
inc sptr
7471
ldy #0 ; Print color = 0
7572
sty PRINT_ARG
7673
jmp print_str_tmp1 ; Print string in tmp1

src/syntax/basic.syn

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ PRINT_SEP_EOL:
290290
"Tab" T_EXPR emit TOK_PRINT_TAB
291291
# Right-TAB is complicated because we need to apply it to the *next*
292292
# parameter, so we read that parameter and the next optional separator:
293-
"RTab" T_EXPR emit TOK_PUSH \
294-
PRINT_ONE emit { TOK_PRINT_RTAB } PRINT_SEP_EOL
293+
"RTab" T_EXPR emit { TOK_BYTE_POKE, PRINT_ARG } PRINT_ONE emit { TOK_PRINT_RTAB } PRINT_SEP_EOL
295294
"," emit { TOK_BYTE, 10, TOK_PRINT_TAB }
296295
";"
297296
E_EOL emit { TOK_BYTE_PUT, ATEOL }

0 commit comments

Comments
 (0)