我有这段代码。有人可以解释为什么它不起作用,我希望每 5 秒打印一次“语法错误”
提前致谢
tks = 177560
tkb = 177562
tps = 177564
tpb = 177566
lcs = 177546
. = torg + 2000
main: mov #main, sp
mov #outp, @#64
mov #200, @#66
mov #clock, @#100
mov #300, @#102
mov #101, @#tks
mov #100, @#tps
mov #100, @#lcs
prog: mov #msg, -(sp)
br outp
clock: inc time_is
cmp time_is, time_out
bne clk_end
clr time_is
jmp prog
clk_end:rti
outp:
mov r1,-(sp)
mov r2,-(sp)
mov 6(sp),r2
str_loop:
movb (r2)+,r1
beq pr_str_end
jsr pc, print_char
br str_loop
pr_str_end:
mov (sp)+,r2
mov (sp)+,r1
rts pc
print_char:
tstb @#tps
bpl print_char
movb r1, @#tpb
rts pc
. = torg + 3000
msg:.ascii<Syntax Error>
.byte 0
.even
time_out: .word 300
time_is: .word 0
buffer: .blkw 3