aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chambers <[email protected]>2021-10-11 12:03:17 +1300
committerAndrew Chambers <[email protected]>2021-10-11 12:03:17 +1300
commit01b5a69f2d7e7ec041064e88d0789ad6d6bc92eb (patch)
treec93bfa1a6bda4960a0361ef252e48c7fae08ec6e
parentdd694b1efdf09eeb063807a94305c5e933d4fea9 (diff)
Add more references.
-rw-r--r--README.md1
-rw-r--r--main.c8
-rw-r--r--test/test.sh2
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