X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;ds=sidebyside;f=client%2Finterpret.c;h=08a20df648a79d81550143eedf1ac6f6e036f552;hb=3fe035b92e9bc0b745c57db64e78461b2f36b6d1;hp=6f2f20d7ae70967f46a2e86c34d2b4a29f73096a;hpb=f10c8c6d2c5c461eadac5ffedab68730fb753461;p=mTask.git diff --git a/client/interpret.c b/client/interpret.c index 6f2f20d..08a20df 100644 --- a/client/interpret.c +++ b/client/interpret.c @@ -16,13 +16,14 @@ #define f16(p) program[pc]*265+program[pc+1] +uint16_t stack[STACKSIZE] = {0}; + void run_task(struct task *t) { uint8_t *program = t->bc; int plen = t->tasklength; int pc = 0; int sp = 0; - char stack[STACKSIZE] = {0}; debug("Running task with length: %d", plen); while(pc < plen){ switch(program[pc++]){ @@ -161,6 +162,10 @@ void run_task(struct task *t) sp--; break; #endif + case BCRETURN: trace("Return"); + debug("Task returned"); + task_delete(t->taskid); + return; default: trace("unrecognized"); die("Unrecognized command: %d", program[pc-1]);