X-Git-Url: http://git.subgeniuskitty.com/vvhitespace/.git/blobdiff_plain/6b5e4b38b5fff236dce186ec191390d92d227a47..e5ba12f2147dfdc42ed1531dfacb2565f6f660a3:/vv_interpreter.c diff --git a/vv_interpreter.c b/vv_interpreter.c index 5ec36eb..cf5cdef 100644 --- a/vv_interpreter.c +++ b/vv_interpreter.c @@ -15,9 +15,9 @@ #define VERSION 1 -#define HEAPSIZE 1024 /* Size of heap in words */ -#define DATASTACKSIZE 1024 /* Size of stack in words */ -#define RETURNSTACKSIZE 1024 /* Max subroutine call depth */ +#define HEAPSIZE 65536 /* Size of heap in words */ +#define DATASTACKSIZE 65536 /* Size of stack in words */ +#define RETURNSTACKSIZE 65536 /* Max subroutine call depth */ void print_usage(char ** argv) @@ -253,7 +253,7 @@ process_imp_arithmetic(uint8_t * code, size_t * pc, int64_t ** sp) case '\t': /* Modulo */ temp = stack_pop(sp); - stack_push(sp, stack_pop(sp)%temp); + stack_push(sp, llabs(stack_pop(sp) % llabs(temp))); break; default: ws_die(pc, "malformed arithmetic IMP"); break; } @@ -455,8 +455,8 @@ main(int argc, char ** argv) if (pc >= ws_code_size) { fprintf(stderr, "SIM_ERROR: PC Overrun\n Requested PC: %lu\n Max Address: %lu\n", pc, ws_code_size-1); - exit(EXIT_FAILURE); unset_terminal_mode(); + exit(EXIT_FAILURE); } /* Decode the IMPs */