stack[sp] = stack[sp] > 0 ? 0 : 1;
break;
case BCADD: trace("add");
- stack[sp-2] = stack[sp-1] + stack[sp-2];
+ stack[sp-2] = stack[sp-2] + stack[sp-1];
sp -= 1;
break;
case BCSUB: trace("sub");
- stack[sp-2] = stack[sp-1] - stack[sp-2];
+ stack[sp-2] = stack[sp-2] - stack[sp-1];
sp -= 1;
break;
case BCMUL: trace("mul");
- stack[sp-2] = stack[sp-1] * stack[sp-2];
+ stack[sp-2] = stack[sp-2] * stack[sp-1];
sp -= 1;
break;
case BCDIV: trace("div");
- stack[sp-2] = stack[sp-1] / stack[sp-2];
+ stack[sp-2] = stack[sp-2] / stack[sp-1];
sp -= 1;
break;
case BCAND: trace("and");
- stack[sp-2] = stack[sp-1] && stack[sp-2];
+ stack[sp-2] = stack[sp-2] && stack[sp-1];
sp -= 1;
break;
case BCOR: trace("or");
- stack[sp-2] = stack[sp-1] || stack[sp-2];
+ stack[sp-2] = stack[sp-2] || stack[sp-1];
sp -= 1;
break;
case BCEQ: trace("eq");
- stack[sp-2] = stack[sp-1] == stack[sp-2];
+ stack[sp-2] = stack[sp-2] == stack[sp-1];
sp -= 1;
break;
case BCNEQ: trace("neq");
- stack[sp-2] = stack[sp-1] != stack[sp-2];
+ stack[sp-2] = stack[sp-2] != stack[sp-1];
sp -= 1;
break;
case BCLES: trace("les");
- stack[sp-2] = stack[sp-1] < stack[sp-2];
+ stack[sp-2] = stack[sp-2] < stack[sp-1];
sp -= 1;
break;
case BCGRE: trace("gre");
- stack[sp-2] = stack[sp-1] > stack[sp-2];
+ stack[sp-2] = stack[sp-2] > stack[sp-1];
sp -= 1;
break;
case BCLEQ: trace("leq");
- stack[sp-2] = stack[sp-1] <= stack[sp-2];
+ stack[sp-2] = stack[sp-2] <= stack[sp-1];
sp -= 1;
break;
case BCGEQ: trace("geq");
- stack[sp-2] = stack[sp-1] >= stack[sp-2];
+ stack[sp-2] = stack[sp-2] >= stack[sp-1];
sp -= 1;
break;
case BCJMP: trace("jmp to %d", program[pc]);