aboutsummaryrefslogtreecommitdiff
path: root/asm.peg
diff options
context:
space:
mode:
authorAndrew Chambers <[email protected]>2021-10-10 20:59:58 +1300
committerAndrew Chambers <[email protected]>2021-10-10 20:59:58 +1300
commit455ad9e979015cde50cd1f89a028aa0dd165b8b3 (patch)
tree68d024930b7c5068955530cb13493efba7637f56 /asm.peg
parent6c881983cad0ac9b8896d41e2335f63c416325d4 (diff)
Add more directives and some simple opcodes.
Diffstat (limited to 'asm.peg')
-rw-r--r--asm.peg8
1 files changed, 7 insertions, 1 deletions
diff --git a/asm.peg b/asm.peg
index d87dd7b..a4db0a5 100644
--- a/asm.peg
+++ b/asm.peg
@@ -24,7 +24,11 @@ directive =
| "balign" ws n:number
{ $$.balign = (Balign){.kind = ASM_DIR_BALIGN, .align = n.i64 }; }
| "byte" ws n:number
- { $$.byte = (Byte){.kind = ASM_DIR_BYTE, .b = (uint8_t)n.i64 }; }
+ { $$.dirbyte = (Byte){.kind = ASM_DIR_BYTE, .v = n.i64 }; }
+ | "int" ws n:number
+ { $$.dirint = (Int){.kind = ASM_DIR_INT, .v = n.i64 }; }
+ | "quad" ws n:number
+ { $$.dirquad = (Quad){.kind = ASM_DIR_QUAD, .v = n.i64 }; }
| sd:section-directive { $$ = sd; }
section-directive =
@@ -52,6 +56,8 @@ instr =
"nop" { $$.kind = ASM_NOP; }
| "leave" { $$.kind = ASM_LEAVE; }
| "ret" { $$.kind = ASM_RET; }
+ | "cltd" { $$.kind = ASM_CLTD; }
+ | "cqto" { $$.kind = ASM_CQTO; }
| i:push { $$ = i; }
| i:pop { $$ = i; }
| i:call { $$ = i; }