diff options
| author | Andrew Chambers <[email protected]> | 2021-10-09 12:14:13 +1300 |
|---|---|---|
| committer | Andrew Chambers <[email protected]> | 2021-10-09 12:14:13 +1300 |
| commit | 08716714c914e696ffbd1410fa7f16a0bc18ad1c (patch) | |
| tree | 6dba906e095e999bb2aefe36d64ff3141f705e33 /minias.h | |
| parent | 8c0f425c60720ad364dea03722df2bba2b863405 (diff) | |
More instructions, refactor.
Diffstat (limited to 'minias.h')
| -rw-r--r-- | minias.h | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -57,6 +57,9 @@ typedef enum { // Instructions ASM_NOP, ASM_RET, + ASM_PUSH, + ASM_POP, + ASM_CALL, ASM_JMP, ASM_LEAVE, ASM_ADD, @@ -203,14 +206,25 @@ typedef String Asciiz; typedef struct { AsmKind kind; const char *target; +} Call; + +typedef struct { + AsmKind kind; + const char *target; } Jmp; typedef struct { AsmKind kind; uint8_t variant; + Parsev *arg; +} Instr1; + +typedef struct { + AsmKind kind; + uint8_t variant; Parsev *src; Parsev *dst; -} Instr; +} Instr2; union Parsev { AsmKind kind; @@ -220,7 +234,9 @@ union Parsev { Ascii ascii; Asciiz asciiz; Memarg memarg; - Instr instr; + Instr1 instr1; + Instr2 instr2; + Call call; Jmp jmp; Byte byte; Imm imm; |
