(uxn.c) Catch JCI underflow
This commit is contained in:
parent
abfeead04c
commit
c97d19da99
5
makefile
5
makefile
|
@ -15,11 +15,10 @@ rom:
|
||||||
@ ./bin/uxnasm etc/polycat.tal bin/polycat.rom
|
@ ./bin/uxnasm etc/polycat.tal bin/polycat.rom
|
||||||
run: bin/uxnasm bin/uxncli bin/uxn11 rom
|
run: bin/uxnasm bin/uxncli bin/uxn11 rom
|
||||||
@ ./bin/uxn11 bin/polycat.rom
|
@ ./bin/uxn11 bin/polycat.rom
|
||||||
cli: bin/uxnasm bin/uxncli
|
|
||||||
@ ./bin/uxnasm etc/opctest.tal bin/opctest.rom
|
|
||||||
@ ./bin/uxncli bin/opctest.rom
|
|
||||||
test: bin/uxnasm bin/uxncli bin/uxn11
|
test: bin/uxnasm bin/uxncli bin/uxn11
|
||||||
@ ./bin/uxnasm && ./bin/uxncli && ./bin/uxn11 && ./bin/uxnasm -v && ./bin/uxncli -v && ./bin/uxn11 -v
|
@ ./bin/uxnasm && ./bin/uxncli && ./bin/uxn11 && ./bin/uxnasm -v && ./bin/uxncli -v && ./bin/uxn11 -v
|
||||||
|
@ ./bin/uxnasm etc/opctest.tal bin/opctest.rom
|
||||||
|
@ ./bin/uxncli bin/opctest.rom
|
||||||
install: bin/uxnasm bin/uxncli bin/uxn11
|
install: bin/uxnasm bin/uxncli bin/uxn11
|
||||||
@ cp bin/uxn11 bin/uxnasm bin/uxncli ~/bin/
|
@ cp bin/uxn11 bin/uxnasm bin/uxncli ~/bin/
|
||||||
uninstall:
|
uninstall:
|
||||||
|
|
|
@ -48,7 +48,7 @@ uxn_eval(Uxn *u, Uint16 pc)
|
||||||
switch(ins & 0x1f ? ins & 0x3f : ins << 4) {
|
switch(ins & 0x1f ? ins & 0x3f : ins << 4) {
|
||||||
/* IMM */
|
/* IMM */
|
||||||
case 0x000: /* BRK */ return 1;
|
case 0x000: /* BRK */ return 1;
|
||||||
case 0x200: /* JCI */ if(!s->dat[--s->ptr]) { pc += 2; break; } /* else fallthrough */
|
case 0x200: /* JCI */ t=T; SET(0,-1) if(!t) { pc += 2; break; } /* else fallthrough */
|
||||||
case 0x400: /* JMI */ pc += PEEK2(ram + pc) + 2; break;
|
case 0x400: /* JMI */ pc += PEEK2(ram + pc) + 2; break;
|
||||||
case 0x600: /* JSI */ SET(0, 2) PUT2(pc + 2) pc += PEEK2(ram + pc) + 2; break;
|
case 0x600: /* JSI */ SET(0, 2) PUT2(pc + 2) pc += PEEK2(ram + pc) + 2; break;
|
||||||
case 0x800: /* LIT */ case 0xc00: SET(0, 1) PUT1(ram[pc++]) break;
|
case 0x800: /* LIT */ case 0xc00: SET(0, 1) PUT1(ram[pc++]) break;
|
||||||
|
|
Loading…
Reference in New Issue