uxn/examples/hello.usm

26 lines
527 B
Plaintext
Raw Normal View History

2021-02-11 03:05:40 +00:00
( hello world, to console )
2021-02-06 18:39:13 +00:00
2021-02-11 03:05:40 +00:00
:dev/w fff9 ( const write port )
;i 1 ( var iterator )
2021-02-06 18:39:13 +00:00
|0100 @RESET
2021-02-13 21:21:05 +00:00
#00 ,dev/w STR ( set dev/write to console )
2021-02-06 18:39:13 +00:00
2021-02-13 21:21:05 +00:00
@word1 "hello_world ( len: 0x0b )
2021-02-06 18:39:13 +00:00
2021-02-11 03:05:40 +00:00
@loop
2021-02-13 21:21:05 +00:00
IOW ( write to device#0 )
,i LDR #01 ADD ,i STR ( increment itr )
,i LDR ( a = i )
,word1 ,strlen JSR ( b = string length )
NEQ ,loop ROT JSR? POP^ ( a != b ? loop )
2021-02-06 18:39:13 +00:00
2021-02-11 03:05:40 +00:00
BRK
2021-02-06 18:39:13 +00:00
2021-02-13 21:21:05 +00:00
@strlen #0001 ADD2 LDR RTS
2021-02-06 18:39:13 +00:00
|c000 @FRAME BRK
|d000 @ERROR BRK
|FFFA .RESET .FRAME .ERROR