diff options
| author | Andrew Chambers <[email protected]> | 2021-10-23 23:57:24 +1300 |
|---|---|---|
| committer | Andrew Chambers <[email protected]> | 2021-10-23 23:57:24 +1300 |
| commit | 6b9b596fcd588d22e15f259b572ae8845fbddacb (patch) | |
| tree | 1cf1758d7a65e90e8a9d40a91887bd5501506d27 /minias.h | |
| parent | 1e9bf39a1b2c47920def55f29c4b9b93c402e1d4 (diff) | |
Implement the .set directive.
Diffstat (limited to 'minias.h')
| -rw-r--r-- | minias.h | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -21,9 +21,14 @@ typedef struct { } Section; typedef struct { + int64_t c; + const char *l; +} Value; + +typedef struct { const char *name; int32_t idx; - int64_t offset; + Value value; int64_t wco; /* worst case offset */ int64_t size; int global; @@ -52,6 +57,7 @@ typedef enum { ASM_DIR_SECTION, ASM_DIR_ASCII, ASM_DIR_ASCIIZ, + ASM_DIR_SET, ASM_DIR_DATA, ASM_DIR_TEXT, ASM_DIR_FILL, @@ -170,6 +176,12 @@ typedef struct Globl { const char *name; } Globl; +typedef struct Set { + AsmKind kind; + const char *sym; + Value value; +} Set; + typedef struct DirSection { AsmKind kind; int32_t type; @@ -177,11 +189,6 @@ typedef struct DirSection { const char *flags; } DirSection; -typedef struct { - int64_t c; - const char *l; -} Value; - typedef struct Byte { AsmKind kind; Value value; @@ -298,6 +305,7 @@ union Parsev { Instr instr; Jmp jmp; Fill fill; + Set set; Byte dirbyte; Short dirshort; Int dirint; |
