diff --git a/src/uxn.c b/src/uxn.c index 1d1b12f..a0bca6f 100644 --- a/src/uxn.c +++ b/src/uxn.c @@ -50,8 +50,8 @@ uxn_eval(Uxn *u, Uint16 pc) switch(opcode - (!opcode * (instr >> 5))) { /* Literals/Calls */ case -0x0: /* BRK */ return 1; - case -0x1: /* JMI */ PEEK16(a, pc) pc += a + 2; break; - case -0x2: /* JCI */ sp = &u->wst->ptr; src = u->wst; POP8(b) if(b) { PEEK16(a, pc) pc += a + 2; } else pc += 2; break; + case -0x1: /* JCI */ POP8(b) if(!b) { pc += 2; break; } + case -0x2: /* JMI */ PEEK16(a, pc) pc += a + 2; break; case -0x3: /* JSI */ PUSH16(u->rst, pc + 2) PEEK16(a, pc) pc += a + 2; break; case -0x4: /* LIT */ case -0x6: /* LITr */ a = u->ram[pc++]; PUSH8(src, a) break; diff --git a/src/uxnasm.c b/src/uxnasm.c index b43fa38..b229da3 100644 --- a/src/uxnasm.c +++ b/src/uxnasm.c @@ -317,10 +317,10 @@ parse(char *w, FILE *f) case ';': /* literal short absolute */ makereference(p.scope, w, p.ptr + 1); return writeshort(0xffff, 1); - case '!': /* JMI */ + case '?': /* JCI */ makereference(p.scope, w, p.ptr + 1); return writebyte(0x20) && writeshort(0xffff, 0); - case '?': /* JCI */ + case '!': /* JMI */ makereference(p.scope, w, p.ptr + 1); return writebyte(0x40) && writeshort(0xffff, 0); case '"': /* raw string */