diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-04-10 08:31:10 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-04-10 08:31:10 -0700 |
commit | 73d253fd864385a5346b0af843662475f77ba23c (patch) | |
tree | 0c3e6e83a8f7d739478dfcde10a1a6df583c63da | |
parent | fe9739b69bed76416cd8102ccbcb436748f9ca22 (diff) | |
download | mu-73d253fd864385a5346b0af843662475f77ba23c.tar.gz |
5071
-rw-r--r-- | subx/Readme.md | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/subx/Readme.md b/subx/Readme.md index fb167276..c0a11c42 100644 --- a/subx/Readme.md +++ b/subx/Readme.md @@ -121,24 +121,27 @@ understanding of your computer. Most instructions operate on an operand in register or memory ('reg/mem'), and a second operand in a register. The register operand is specified fairly -directly using the `/r32` argument. The reg/mem operand, however, gets -complex. It can be specified by 1-7 arguments, each ranging in size from 2 -bits to 4 bytes. +directly using the 3-bit `/r32` argument: + + - 0 means register `EAX` + - 1 means register `ECX` + - 2 means register `EDX` + - 3 means register `EBX` + - 4 means register `ESP` + - 5 means register `EBP` + - 6 means register `ESI` + - 7 means register `EDI` + +The reg/mem operand, however, gets complex. It can be specified by 1-7 +arguments, each ranging in size from 2 bits to 4 bytes. The key argument that's always present for reg/mem operands is `/mod`, the _addressing mode_. This is a 2-bit argument that can take 4 possible values, and it determines what other arguments are required, and how to interpret them. -* If `/mod` is `3`: the operand is the register described by the `/rm32` bits: - - 0 means register `EAX` - - 1 means register `ECX` - - 2 means register `EDX` - - 3 means register `EBX` - - 4 means register `ESP` - - 5 means register `EBP` - - 6 means register `ESI` - - 7 means register `EDI` +* If `/mod` is `3`: the operand is the register described by the 3-bit `/rm32` + argument similarly to `/r32` above. * If `/mod` is `0`: the operand is the address provided in the register described by `/rm32`. That's `*rm32` in C syntax. |