From 01b5a69f2d7e7ec041064e88d0789ad6d6bc92eb Mon Sep 17 00:00:00 2001 From: Andrew Chambers Date: Mon, 11 Oct 2021 12:03:17 +1300 Subject: Add more references. --- README.md | 1 + main.c | 8 ++------ test/test.sh | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d3bfecd..1505a4d 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ cc -O2 *.c -o minias # Resources +- [intel reference](https://software.intel.com/content/dam/develop/external/us/en/documents-tps/325383-sdm-vol-2abcd.pdf) - Especially chapter 2 section 1. - [elf spec](https://refspecs.linuxfoundation.org/elf/elf.pdf) - [goas](https://github.com/DQNEO/goas) - [neatas](https://repo.or.cz/neatas.git) diff --git a/main.c b/main.c index 81f31fb..7c796d6 100644 --- a/main.c +++ b/main.c @@ -500,12 +500,8 @@ static void assemblemem(Memarg *memarg, uint8_t rexw, Opcode opcode, } /* If our base is a bp register, we must use the index instead. */ - if ((base & 7) == 5) { - if (memarg->index == ASM_NO_REG) { - index = base; - } else { - // lfatal("bp cannot be used as an addressing base"); - } + if ((base & 7) == 5 && memarg->index == ASM_NO_REG) { + index = base; } switch (memarg->scale) { diff --git a/test/test.sh b/test/test.sh index a5ffc12..574bfad 100644 --- a/test/test.sh +++ b/test/test.sh @@ -216,7 +216,7 @@ do t "${op}l %e${r}x, %eax" t "${op}q %r${r}x, %rax" - if test "$op" = "test" # m -> variants are not supported by test + if test "$op" = "test" # m -> r variants are not supported by test then continue fi -- cgit v1.2.3