0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-27 08:13:01 +00:00
uxn/projects/examples/dev.console.usm
2021-03-06 11:44:18 -08:00

33 lines
No EOL
729 B
Text

( hello world )
&Console { pad 8 char 1 byte 1 short 2 }
|0100 @RESET
,text1 ,print-label JSR
,text2 ,print-label JSR
#ab =dev/console.byte
#cdef =dev/console.short
BRK
@print-label ( text )
@print-label-loop
DUP2 LDR =dev/console.char ( write pointer value to console )
#0001 ADD2 ( increment string pointer )
DUP2 LDR #00 NEQ ,print-label-loop ROT JMP? POP2 ( while *ptr!=0 goto loop )
POP2
RTS
@text1 [ Hello 20 World 0a00 ] ( store text with a linebreak and null byte )
@text2 [ Welcome 20 to 20 UxnVM 0a00 ]
|c000 @FRAME
|d000 @ERROR
|FF00 ;dev/console Console
|FFF0 .RESET .FRAME .ERROR ( vectors )
|FFF8 [ 13fd 1ef3 1bf2 ] ( palette )