0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-09 15:55:05 +00:00
uxn/examples/hello.usm
2021-02-10 19:05:40 -08:00

26 lines
477 B
Text

( hello world, to console )
:dev/w fff9 ( const write port )
;i 1 ( var iterator )
|0100 @RESET
,00 ,dev/w STR ( set dev/write to console )
@word1 "hello_world ( len: 0x0b )
@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 )
BRK
@strlen ,0001 ADD^ LDR RTS
@incr ,i LDR ,01 ADD ,i STR RTS
|c000 @FRAME BRK
|d000 @ERROR BRK
|FFFA .RESET .FRAME .ERROR