6 SET A, 0x30 ; 7c01 0030
7 SET [0x1000], 0x20 ; 7de1 1000 0020
8 SUB A, [0x1000] ; 7803 1000
10 SET PC, crash ; 7dc1 001a [*]
14 SET A, 0x2000 ; 7c01 2000
15 :loop SET [0x2000+I], [A] ; 2161 2000
18 SET PC, loop ; 7dc1 000d [*]
22 JSR testsub ; 7c10 0018 [*]
23 SET PC, crash ; 7dc1 001a [*]
25 :testsub SHL X, 4 ; 9037
28 ; Hang forever. X should now be 0x40 if everything went right.
29 :crash SET PC, crash ; 7dc1 001a [*]
31 ; [*]: Note that these can be one word shorter and one cycle faster by using the short form (0x00-0x1f) of literals,
32 ; but my assembler doesn't support short form labels yet.