From 455ad9e979015cde50cd1f89a028aa0dd165b8b3 Mon Sep 17 00:00:00 2001 From: Andrew Chambers Date: Sun, 10 Oct 2021 20:59:58 +1300 Subject: Add more directives and some simple opcodes. --- minias.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'minias.h') diff --git a/minias.h b/minias.h index 4d05a03..83eea1a 100644 --- a/minias.h +++ b/minias.h @@ -53,6 +53,8 @@ typedef enum { ASM_DIR_DATA, ASM_DIR_TEXT, ASM_DIR_BYTE, + ASM_DIR_INT, + ASM_DIR_QUAD, ASM_DIR_BALIGN, // Instructions ASM_NOP, @@ -60,6 +62,8 @@ typedef enum { ASM_PUSH, ASM_POP, ASM_CALL, + ASM_CLTD, + ASM_CQTO, ASM_JMP, ASM_LEAVE, ASM_ADD, @@ -181,9 +185,19 @@ typedef struct { typedef struct { AsmKind kind; - uint8_t b; + int64_t v; } Byte; +typedef struct { + AsmKind kind; + int64_t v; +} Int; + +typedef struct { + AsmKind kind; + int64_t v; +} Quad; + typedef struct { AsmKind kind; uint64_t align; @@ -242,7 +256,9 @@ union Parsev { Instr instr; Call call; Jmp jmp; - Byte byte; + Byte dirbyte; + Int dirint; + Quad dirquad; Imm imm; String string; // Temporary values. -- cgit v1.2.3