From 073a23152e509d42ce256f635fbb3da99e0d176a Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sun, 22 Oct 2023 20:29:02 +0100 Subject: Use conversion functions for (h)word to and from bytes instead of bit shifting Wasn't very secure for endianness, and using these helpers abstracts the details away a bit in case I want to enforce a certain system. --- src/runtime.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/runtime.h') diff --git a/src/runtime.h b/src/runtime.h index 3e4c295..5ee5f9b 100644 --- a/src/runtime.h +++ b/src/runtime.h @@ -83,6 +83,10 @@ static const push_reg_f PUSH_REG_ROUTINES[] = { [OP_PUSH_REGISTER_WORD] = vm_push_word_register, }; +data_t vm_pop_byte(vm_t *); +data_t vm_pop_hword(vm_t *); +data_t vm_pop_word(vm_t *); + data_t vm_mov_byte(vm_t *, byte); data_t vm_mov_hword(vm_t *, byte); data_t vm_mov_word(vm_t *, byte); @@ -94,9 +98,6 @@ static const mov_f MOV_ROUTINES[] = { [OP_MOV_WORD] = vm_mov_word, }; -data_t vm_pop_byte(vm_t *); -data_t vm_pop_hword(vm_t *); -data_t vm_pop_word(vm_t *); void vm_not_byte(vm_t *); void vm_not_hword(vm_t *); -- cgit v1.2.3-13-gbd6f