diff options
author | Bad Diode <bd@badd10de.dev> | 2023-08-29 08:53:46 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2023-08-29 08:53:46 +0200 |
commit | b3d77b2986e59fec41eaa611d6933d7caac24d92 (patch) | |
tree | 9f09d294bd9889d9a32f286e1c155ded9a1fbed4 /src | |
parent | c0f929c1ab793e45d1e38b41bc41e376a7e94621 (diff) | |
download | uxngba-b3d77b2986e59fec41eaa611d6933d7caac24d92.tar.gz uxngba-b3d77b2986e59fec41eaa611d6933d7caac24d92.zip |
Add conditional jumps jcn/jcn2
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 6 | ||||
-rw-r--r-- | src/uxn-core.s | 10 |
2 files changed, 15 insertions, 1 deletions
@@ -140,7 +140,11 @@ init_uxn() { | |||
140 | // 0xa0, 0xab, 0xcd, 0xa0, 0x01, 0x08, 0x35, | 140 | // 0xa0, 0xab, 0xcd, 0xa0, 0x01, 0x08, 0x35, |
141 | // JMP | 141 | // JMP |
142 | // 0x80, 0x01, 0x0c, 0x00, 0x80, 0xaa, | 142 | // 0x80, 0x01, 0x0c, 0x00, 0x80, 0xaa, |
143 | 0xa0, 0x01, 0x05, 0x2c, 0x00, 0x80, 0xbb, | 143 | // 0xa0, 0x01, 0x05, 0x2c, 0x00, 0x80, 0xbb, |
144 | // 0xa0, 0xab, 0xcd, 0x80, 0x01, 0x80, 0x01, 0x0d, 0x04, 0x02, | ||
145 | // 0xa0, 0xab, 0xcd, 0x80, 0x00, 0x80, 0x01, 0x0d, 0x04, 0x02, | ||
146 | 0xa0, 0xab, 0xcd, 0x80, 0x01, 0xa0, 0x01, 0x0a, 0x2d, 0x04, 0x02, | ||
147 | 0xa0, 0xab, 0xcd, 0x80, 0x00, 0xa0, 0x01, 0x15, 0x2d, 0x04, 0x02, | ||
144 | }; | 148 | }; |
145 | memcpy(uxn_ram + PAGE_PROGRAM, uxn_rom, sizeof(uxn_rom)); | 149 | memcpy(uxn_ram + PAGE_PROGRAM, uxn_rom, sizeof(uxn_rom)); |
146 | } | 150 | } |
diff --git a/src/uxn-core.s b/src/uxn-core.s index c14c0f3..71f7c5e 100644 --- a/src/uxn-core.s +++ b/src/uxn-core.s | |||
@@ -609,9 +609,19 @@ jmp2: | |||
609 | b uxn_decode | 609 | b uxn_decode |
610 | 610 | ||
611 | jcn: | 611 | jcn: |
612 | wpop8s r3 | ||
613 | wpop8 r4 | ||
614 | cmp r4, #0 | ||
615 | addne r0, r3 | ||
612 | b uxn_decode | 616 | b uxn_decode |
613 | 617 | ||
614 | jcn2: | 618 | jcn2: |
619 | wpop16 r3, r5 | ||
620 | wpop8 r4 | ||
621 | cmp r4, #0 | ||
622 | movne r0, r7 | ||
623 | cmp r4, #0 | ||
624 | addne r0, r0, r3 | ||
615 | b uxn_decode | 625 | b uxn_decode |
616 | 626 | ||
617 | jsr: | 627 | jsr: |