aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chambers <[email protected]>2021-10-19 15:51:57 +1300
committerAndrew Chambers <[email protected]>2021-10-19 15:51:57 +1300
commit375efafb6aeb486ff2b079e8464d4b746ba4f213 (patch)
tree198682c60c1d1adb53ac865a64b072b9d56d61d7
parent480677bcfc6d83cf2e1428bdaeed6eb81dbe6700 (diff)
Restore memory calls.
-rw-r--r--main.c5
-rw-r--r--test/test.sh1
2 files changed, 3 insertions, 3 deletions
diff --git a/main.c b/main.c
index 6c3c710..f12ece5 100644
--- a/main.c
+++ b/main.c
@@ -488,9 +488,8 @@ assemblecall(const Call* call)
if (call->indirect) {
if (call->target.indirect->kind == ASM_MEMARG) {
- rex = (Rex){ 0 };
- abort(); // assemblemem(&call->target.indirect->memarg, rex, -1,
- // 0xff, 0x02);
+ rex = (Rex){0};
+ assemblemem(&call->target.indirect->memarg, rex, -1, 0xff, 0x02, 0);
} else {
rm = regbits(call->target.indirect->kind);
rex = (Rex){ .b = !!(rm & (1 << 3)) };
diff --git a/test/test.sh b/test/test.sh
index 5ef1266..0b959ae 100644
--- a/test/test.sh
+++ b/test/test.sh
@@ -40,6 +40,7 @@ t "movq $-4132994306676758123, %rcx"
t "mov \$17293822569102704639, %rax"
t "callq *%rax"
t "callq *%r10"
+t "callq *(%r10)"
t "movb %r11b, (%rsi, %r12, 1)"
for r in rax r10