aboutsummaryrefslogtreecommitdiff
path: root/minias.h
diff options
context:
space:
mode:
authorAndrew Chambers <[email protected]>2021-10-06 01:22:20 +1300
committerAndrew Chambers <[email protected]>2021-10-06 01:22:20 +1300
commit7358b6242d46247286e9fec949795ddf098d1d3a (patch)
tree19a20e1097e7059b7132593a909d711db1057605 /minias.h
parente0b52ff23ca304d581f80f0d9bd2de76fb042d03 (diff)
Refactor modrm commands.
Diffstat (limited to 'minias.h')
-rw-r--r--minias.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/minias.h b/minias.h
index 9889733..126c842 100644
--- a/minias.h
+++ b/minias.h
@@ -48,7 +48,11 @@ typedef enum {
ASM_JMP,
ASM_LEAVE,
ASM_ADD,
+ ASM_AND,
+ ASM_SUB,
+ ASM_XOR,
// Registers, order matters.
+ ASM_REG_BEGIN,
ASM_EAX,
ASM_ECX,
ASM_EDX,
@@ -73,6 +77,7 @@ typedef enum {
ASM_R13,
ASM_R14,
ASM_R15,
+ ASM_REG_END,
} AsmKind;
typedef union Parsev Parsev;
@@ -130,7 +135,10 @@ typedef struct {
char type;
Parsev *src;
Parsev *dst;
-} Add;
+} ModRMBinop;
+
+typedef ModRMBinop Add;
+typedef ModRMBinop Sub;
union Parsev {
AsmKind kind;
@@ -138,7 +146,9 @@ union Parsev {
Globl globl;
Balign balign;
Memarg memarg;
+ ModRMBinop modrmbinop;
Add add;
+ Sub sub;
Jmp jmp;
Byte byte;
Imm imm;