aboutsummaryrefslogtreecommitdiff
path: root/asm.peg
diff options
context:
space:
mode:
authorAndrew Chambers <[email protected]>2021-10-19 16:15:49 +1300
committerAndrew Chambers <[email protected]>2021-10-19 16:15:49 +1300
commit221b83997a22fc2abc2282d90763e0435943021c (patch)
tree7e89cee98dad066e3d0de4204e21adead95c4dde /asm.peg
parent375efafb6aeb486ff2b079e8464d4b746ba4f213 (diff)
Remove special case for call.
Diffstat (limited to 'asm.peg')
-rw-r--r--asm.peg7
1 files changed, 4 insertions, 3 deletions
diff --git a/asm.peg b/asm.peg
index 39c5d0e..089bfb2 100644
--- a/asm.peg
+++ b/asm.peg
@@ -134,11 +134,12 @@ instr =
call = "call" 'q'? ws (
'*' t:mem
- { $$.call = (Call){ .kind = ASM_CALL, .target.indirect=internparsev(&t), .indirect=1 } ; }
+ { $$ = OPMEM({.w=0}, -1, 0xff, 0x02, t); }
| '*' t:r64
- { $$.call = (Call){ .kind = ASM_CALL, .target.indirect=internparsev(&t), .indirect=1 } ; }
+ { $$ = OPREG({.w=0}, -1, 0xff, 0x02, t); }
| t:value
- { $$.call = (Call){ .kind = ASM_CALL, .target.direct=t.value, .indirect=0 } ; }
+ { Parsev ma = (Parsev){.memarg = (Memarg) {.kind=ASM_MEMARG, .disp = t.value }};
+ $$ = RELCALL({.w=0}, -1, 0xe8, ma); }
)
jmp = 'j' v:jmp-variant ws t:ident