aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode/vm.h
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-10-23 13:01:10 +0200
committerBad Diode <bd@badd10de.dev>2021-10-23 13:01:10 +0200
commit928a58ad7977c0e2e445fd9c16db5726cda789e0 (patch)
treecfa97b293213550253b268c59100e37f9246b4f1 /src/bytecode/vm.h
parent9bb350e99370009a18df3c3b8f512d2c11168978 (diff)
downloadbdl-928a58ad7977c0e2e445fd9c16db5726cda789e0.tar.gz
bdl-928a58ad7977c0e2e445fd9c16db5726cda789e0.zip
Add (buggy) initial compilation of arithmetic ops
Diffstat (limited to 'src/bytecode/vm.h')
-rwxr-xr-x[-rw-r--r--]src/bytecode/vm.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bytecode/vm.h b/src/bytecode/vm.h
index f9e64d1..3a9b5af 100644..100755
--- a/src/bytecode/vm.h
+++ b/src/bytecode/vm.h
@@ -81,7 +81,7 @@ vm_interpret(VM vm, Chunk *chunk) {
81 case OP_SUB: { 81 case OP_SUB: {
82 Object a = array_pop(vm.stack); 82 Object a = array_pop(vm.stack);
83 Object b = array_pop(vm.stack); 83 Object b = array_pop(vm.stack);
84 array_push(vm.stack, a - b); 84 array_push(vm.stack, b - a);
85 } break; 85 } break;
86 case OP_MUL: { 86 case OP_MUL: {
87 Object a = array_pop(vm.stack); 87 Object a = array_pop(vm.stack);
@@ -91,7 +91,7 @@ vm_interpret(VM vm, Chunk *chunk) {
91 case OP_DIV: { 91 case OP_DIV: {
92 Object a = array_pop(vm.stack); 92 Object a = array_pop(vm.stack);
93 Object b = array_pop(vm.stack); 93 Object b = array_pop(vm.stack);
94 array_push(vm.stack, a / b); 94 array_push(vm.stack, b / a);
95 } break; 95 } break;
96 case OP_MOD: { 96 case OP_MOD: {
97 Object a = array_pop(vm.stack); 97 Object a = array_pop(vm.stack);