aboutsummaryrefslogtreecommitdiff
path: root/src/runtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime.c')
-rw-r--r--src/runtime.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/runtime.c b/src/runtime.c
index 19115b6..b330a61 100644
--- a/src/runtime.c
+++ b/src/runtime.c
@@ -456,3 +456,32 @@ void vm_xor_word(vm_t *vm)
vm_push_word(vm, DWORD(a ^ b));
}
+void vm_eq_byte(vm_t *vm)
+{
+ if (vm->stack.ptr < 2)
+ // TODO: Error STACK_UNDERFLOW
+ return;
+ byte a = vm_pop_byte(vm).as_byte;
+ byte b = vm_pop_byte(vm).as_byte;
+ vm_push_byte(vm, DBYTE(a == b));
+}
+
+void vm_eq_hword(vm_t *vm)
+{
+ if (vm->stack.ptr < (HWORD_SIZE * 2))
+ // TODO: Error STACK_UNDERFLOW
+ return;
+ hword a = vm_pop_hword(vm).as_hword;
+ hword b = vm_pop_hword(vm).as_hword;
+ vm_push_hword(vm, DHWORD(a == b));
+}
+
+void vm_eq_word(vm_t *vm)
+{
+ if (vm->stack.ptr < (WORD_SIZE * 2))
+ // TODO: Error STACK_UNDERFLOW
+ return;
+ word a = vm_pop_word(vm).as_word;
+ word b = vm_pop_word(vm).as_word;
+ vm_push_word(vm, DWORD(a == b));
+}