0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-08 23:35:05 +00:00
uxn/projects/tests/loop.usm

46 lines
601 B
Text
Raw Normal View History

2021-03-14 20:30:17 +00:00
( Loop )
2021-03-11 20:19:59 +00:00
2021-03-14 20:30:17 +00:00
;a { byte 1 } ;b { byte 1 } ;c { byte 1 }
2021-03-11 20:19:59 +00:00
|0100 @RESET
2021-03-14 20:30:17 +00:00
,type1 JSR2
,type2 JSR2
,type3 JSR2
BRK
@type1 ( type: padded muljmp )
2021-03-11 23:47:28 +00:00
$loop NOP
2021-03-11 20:19:59 +00:00
~a #01 ADD =a
2021-03-11 23:47:28 +00:00
~a #d0 LTH ^$loop MUL JMPS
2021-03-14 20:30:17 +00:00
~a =Console.byte
2021-03-11 20:19:59 +00:00
2021-03-14 20:30:17 +00:00
RTS
2021-03-11 20:19:59 +00:00
2021-03-14 20:30:17 +00:00
@type2 ( type: jmppop )
2021-03-11 23:47:28 +00:00
$loop
2021-03-11 20:19:59 +00:00
~b #01 ADD =b
2021-03-11 23:47:28 +00:00
,$loop ~b #d0 LTH JMP2? POP2
2021-03-14 20:30:17 +00:00
~b =Console.byte
RTS
2021-03-11 20:19:59 +00:00
2021-03-14 20:30:17 +00:00
@type3 ( type: padded jmppop )
2021-03-11 20:19:59 +00:00
2021-03-11 23:47:28 +00:00
$loop NOP
2021-03-11 20:19:59 +00:00
~c #01 ADD =c
2021-03-11 23:47:28 +00:00
~c #d0 LTH ^$loop SWP JMPS? POP
2021-03-14 20:30:17 +00:00
~c =Console.byte
2021-03-11 20:19:59 +00:00
2021-03-14 20:30:17 +00:00
RTS
2021-03-11 20:19:59 +00:00
|c000 @FRAME
|d000 @ERROR
2021-03-14 20:30:17 +00:00
|FF00 ;Console { pad 8 char 1 byte 1 short 2 }
2021-03-11 20:19:59 +00:00
|FFF0 .RESET .FRAME .ERROR ( vectors )
|FFF8 [ 13fd 1ef3 1bf2 ] ( palette )