examples/print-args.xyw
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
.include "_macros.xyw"
; Set on_argument event handler
print-args terminal.on_argument STW
; End program
end JMPw
; on_argument event handler
.label print-args
terminal.input POPx
; If end of argument, print new line and end
LDBx $1D EQU print-args.end JCNw
LDBx $1E EQU print-args.next JCNw
; Print typed character
LDBx terminal.output STB
RTS
; Print argument separator (, )
.label print-args.next
$2C terminal.output STB
$20 terminal.output STB
RTS
; Print new line
.label print-args.end
$0A terminal.output STB
RTS
.label end
|