aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chambers <[email protected]>2021-10-20 21:17:13 +1300
committerAndrew Chambers <[email protected]>2021-10-20 21:17:13 +1300
commit5a77e2180415ec70115597d9f950992032a1e239 (patch)
tree858d2407b5f6cd51ef7b9e441535c9eb41f1a5c1
parent54921bd8f385a1a88f203c362252389045e81fbf (diff)
Document assemblemem.
-rw-r--r--main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.c b/main.c
index eecee91..6c12d50 100644
--- a/main.c
+++ b/main.c
@@ -345,12 +345,16 @@ assemblereloc(const char *l, int64_t c, int nbytes, int type)
assembleconstant(c, nbytes);
}
-/* Assemble a r <-> mem operation. */
+/* Assemble a r <-> mem operation.
+
+ In order to understand this function, you should check the intel
+ manual which has tables showing the appropriate values of the modregrm
+ byte and sib byte for the different addressing modes.
+*/
static void
assemblemem(const Memarg *memarg, Rex rex, VarBytes prefix, VarBytes opcode,
uint8_t reg, int32_t nexti)
{
-
uint8_t mod, rm, scale, index, base;
/* Rip relative addressing. */