From 14a3820e7406aa403aab67254f91886d30244b82 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 31 Oct 2023 21:05:25 +0000 Subject: Implemented new types of EQ, forced all comparators to push bytes Just need to call their unsigned versions. All comparators should push bytes as it makes return types uniform. --- vm/runtime.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'vm/runtime.c') diff --git a/vm/runtime.c b/vm/runtime.c index d188b29..82886b8 100644 --- a/vm/runtime.c +++ b/vm/runtime.c @@ -725,8 +725,7 @@ err_t vm_eq_byte(vm_t *vm) err_t vm_eq_char(vm_t *vm) { - (void)vm; - return ERR_END_OF_PROGRAM; + return vm_eq_byte(vm); } err_t vm_eq_hword(vm_t *vm) @@ -738,19 +737,17 @@ err_t vm_eq_hword(vm_t *vm) err = vm_pop_hword(vm, &b); if (err) return err; - return vm_push_hword(vm, DHWORD(a.as_hword == b.as_hword)); + return vm_push_byte(vm, DBYTE(a.as_hword == b.as_hword)); } err_t vm_eq_int(vm_t *vm) { - (void)vm; - return ERR_END_OF_PROGRAM; + return vm_eq_hword(vm); } err_t vm_eq_long(vm_t *vm) { - (void)vm; - return ERR_END_OF_PROGRAM; + return vm_eq_word(vm); } err_t vm_eq_word(vm_t *vm) @@ -762,7 +759,7 @@ err_t vm_eq_word(vm_t *vm) err = vm_pop_word(vm, &b); if (err) return err; - return vm_push_word(vm, DWORD(a.as_word == b.as_word)); + return vm_push_byte(vm, DBYTE(a.as_word == b.as_word)); } err_t vm_lt_byte(vm_t *vm) -- cgit v1.2.3-13-gbd6f