diff --git a/src/uxncli.c b/src/uxncli.c index 6038206..241984b 100644 --- a/src/uxncli.c +++ b/src/uxncli.c @@ -132,9 +132,13 @@ uxn_halt(Uxn *u, Uint8 error, char *name, int id) static void run(Uxn *u) { - uxn_eval(u, PAGE_PROGRAM); - while((!u->dev[0].dat[0xf]) && (read(0, &devconsole->dat[0x2], 1) > 0)) - uxn_eval(u, mempeek16(devconsole->dat, 0)); + Uint16 vec = PAGE_PROGRAM; + uxn_eval(u, vec); + while((!u->dev[0].dat[0xf]) && (read(0, &devconsole->dat[0x2], 1) > 0)) { + vec = mempeek16(devconsole->dat, 0); + if (!vec) vec = u->ram.ptr; /* continue after last BRK */ + uxn_eval(u, vec); + } } static int