0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-12 17:25:05 +00:00
uxn/examples/hello.usm

27 lines
477 B
Text
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-11 03:05:40 +00:00
,00 ,dev/w STR ( set dev/write to console )
2021-02-06 18:39:13 +00:00
2021-02-11 03:05:40 +00:00
@word1 "hello_world ( len: 0x0b )
2021-02-06 18:39:13 +00:00
2021-02-11 03:05:40 +00:00
@loop
IOW ( write to device#0 )
,incr JSR ( increment itr )
,i LDR ( a = i )
,word1 ,strlen JSR ( b = string length )
NEQ ,loop ROT JSR? ( 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-11 03:05:40 +00:00
@strlen ,0001 ADD^ LDR RTS
@incr ,i LDR ,01 ADD ,i STR RTS
2021-02-06 18:39:13 +00:00
|c000 @FRAME BRK
|d000 @ERROR BRK
|FFFA .RESET .FRAME .ERROR