Fixed some bugs with ariphmetic operations
This commit is contained in:
parent
23b8731e40
commit
095dafa97d
1 changed files with 4 additions and 4 deletions
|
@ -134,15 +134,15 @@ int run_interpreter(char* filename)
|
||||||
//DO(DSUB, "Subtract 2 doubles on TOS (lower from upper), push value back.", 1)
|
//DO(DSUB, "Subtract 2 doubles on TOS (lower from upper), push value back.", 1)
|
||||||
d1 = pop_double();
|
d1 = pop_double();
|
||||||
d2 = pop_double();
|
d2 = pop_double();
|
||||||
d2 -= d1;
|
d1 -= d2;
|
||||||
push_double(d2);
|
push_double(d1);
|
||||||
break;
|
break;
|
||||||
case ISUB:
|
case ISUB:
|
||||||
//DO(ISUB, "Subtract 2 ints on TOS (lower from upper), push value back.", 1)
|
//DO(ISUB, "Subtract 2 ints on TOS (lower from upper), push value back.", 1)
|
||||||
i1 = pop_int();
|
i1 = pop_int();
|
||||||
i2 = pop_int();
|
i2 = pop_int();
|
||||||
i2 -= i1;
|
i1 -= i2;
|
||||||
push_int(i2);
|
push_int(i1);
|
||||||
break;
|
break;
|
||||||
case DMUL:
|
case DMUL:
|
||||||
//DO(DMUL, "Multiply 2 doubles on TOS, push value back.", 1)
|
//DO(DMUL, "Multiply 2 doubles on TOS, push value back.", 1)
|
||||||
|
|
Loading…
Reference in a new issue