0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-14 02:05:06 +00:00
uxn/projects/tests/jump.usm

59 lines
775 B
Text
Raw Normal View History

2021-03-11 20:19:59 +00:00
( tests/jump )
2021-03-14 20:30:17 +00:00
|0100 @RESET
2021-03-14 17:40:13 +00:00
,test1 JSR2
2021-03-14 21:26:17 +00:00
,test2 JSR2
2021-03-14 17:40:13 +00:00
BRK
@test1
( should print 11, 22, 33, 44 )
2021-03-11 20:19:59 +00:00
2021-03-14 17:40:13 +00:00
#11 =Console.byte
2021-03-16 01:08:41 +00:00
#03 JMP BRK BRK BRK
2021-03-11 20:19:59 +00:00
( skip foward with id )
2021-03-14 17:40:13 +00:00
#22 =Console.byte
2021-03-16 01:08:41 +00:00
^jump JMP BRK BRK BRK @jump
2021-03-11 20:19:59 +00:00
( skip patterns )
2021-03-14 17:40:13 +00:00
#33 =Console.byte
2021-03-11 20:19:59 +00:00
2021-03-15 22:27:43 +00:00
,skip1 #12 #34 LTH JMP2?
2021-03-14 17:40:13 +00:00
#ff =Console.byte
2021-03-11 20:19:59 +00:00
@skip1
2021-03-16 01:08:41 +00:00
#12 #34 LTH ^skip2 #04 SUB MUL JMP
2021-03-14 17:40:13 +00:00
#ff =Console.byte
2021-03-11 20:19:59 +00:00
@skip2
2021-03-14 17:40:13 +00:00
#44 =Console.byte
2021-03-14 21:26:17 +00:00
RTN
2021-03-14 17:40:13 +00:00
@test2
2021-03-11 20:19:59 +00:00
,end JMP2
( should print aa, bb, cc, dd )
2021-03-16 01:08:41 +00:00
@label1 #aa =Console.byte ^label3 JMP
@label2 #cc =Console.byte ^label4 JMP
@label3 #bb =Console.byte ^label2 JMP
2021-03-14 17:40:13 +00:00
@label4 #dd =Console.byte BRK
2021-03-11 20:19:59 +00:00
@end
2021-03-14 21:26:17 +00:00
RTN
2021-03-11 20:19:59 +00:00
|c000 @FRAME
|d000 @ERROR
2021-03-14 17:40:13 +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 )