0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-27 16:23:02 +00:00
uxn/projects/examples/dev.console.usm

33 lines
729 B
Text
Raw Normal View History

2021-02-20 23:00:34 +00:00
( hello world )
2021-03-01 17:38:54 +00:00
&Console { pad 8 char 1 byte 1 short 2 }
2021-02-20 23:00:34 +00:00
|0100 @RESET
2021-03-01 17:38:54 +00:00
,text1 ,print-label JSR
,text2 ,print-label JSR
#ab =dev/console.byte
#cdef =dev/console.short
2021-02-20 23:00:34 +00:00
BRK
@print-label ( text )
2021-02-22 00:52:51 +00:00
2021-03-01 19:18:11 +00:00
@print-label-loop
2021-03-01 16:55:16 +00:00
DUP2 LDR =dev/console.char ( write pointer value to console )
2021-02-20 23:00:34 +00:00
#0001 ADD2 ( increment string pointer )
2021-03-01 19:18:11 +00:00
DUP2 LDR #00 NEQ ,print-label-loop ROT JMP? POP2 ( while *ptr!=0 goto loop )
POP2
2021-03-01 16:55:16 +00:00
RTS
2021-02-20 23:00:34 +00:00
2021-03-05 21:58:43 +00:00
@text1 [ Hello 20 World 0a00 ] ( store text with a linebreak and null byte )
@text2 [ Welcome 20 to 20 UxnVM 0a00 ]
2021-02-20 23:00:34 +00:00
|c000 @FRAME
|d000 @ERROR
|FF00 ;dev/console Console
|FFF0 .RESET .FRAME .ERROR ( vectors )
2021-03-01 04:52:41 +00:00
|FFF8 [ 13fd 1ef3 1bf2 ] ( palette )