diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-10-22 20:29:02 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-10-22 20:29:02 +0100 |
commit | 073a23152e509d42ce256f635fbb3da99e0d176a (patch) | |
tree | c605f07c39f703b85b0593f97e9b9bbd34232a26 /src/runtime.h | |
parent | aa3d1cb85f7940738468db37211c6841d90e6d4b (diff) | |
download | ovm-073a23152e509d42ce256f635fbb3da99e0d176a.tar.gz ovm-073a23152e509d42ce256f635fbb3da99e0d176a.tar.bz2 ovm-073a23152e509d42ce256f635fbb3da99e0d176a.zip |
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.
Diffstat (limited to 'src/runtime.h')
-rw-r--r-- | src/runtime.h | 7 |
1 files changed, 4 insertions, 3 deletions
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 *); |