Store the result of OP_POP in the last register as a word

Instead of making routines to handle data in the `ret` register, just
store the result of POP into the last word register.

This means we are no longer using vm_pop_* or POP_ROUTINES for the
vm_execute script on OP_POP: instead we'll just use vm_mov_* which
automatically pops the datum for us, while moving the datum to the
last register.
This commit is contained in:
2023-10-22 17:01:15 +01:00
parent 95723f36d2
commit 47c7d6baf7
3 changed files with 111 additions and 23 deletions

View File

@@ -69,6 +69,11 @@ const char *opcode_as_cstr(opcode_t);
#define OPCODE_IS_TYPE(OPCODE, OP_TYPE) \
(((OPCODE) >= OP_TYPE##_BYTE) && ((OPCODE) <= OP_TYPE##_WORD))
#define OPCODE_DATA_TYPE(OPCODE, OP_TYPE) \
((OPCODE) == OP_TYPE##_BYTE ? DATA_TYPE_BYTE \
: ((OPCODE) == OP_TYPE##_HWORD) ? DATA_TYPE_HWORD \
: DATA_TYPE_WORD)
typedef struct
{
opcode_t opcode;