This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:papc:chapter_6_6 [2025/08/01 06:18] – [Scale Index Base byte] ktokarz | en:multiasm:papc:chapter_6_6 [2025/08/01 06:59] (current) – [Scale Index Base byte] ktokarz | ||
|---|---|---|---|
| Line 332: | Line 332: | ||
| ; | ; | ||
| + | ;MOD R/M (second byte) is 0x04 for all instructions: | ||
| + | ; | ||
| + | ; | ||
| ; | ; | ||
| - | mov rax, [rbx+rcx] | + | mov rax, [rbx+rcx] |
| - | mov rax, [rbx+rcx*2] | + | mov rax, [rbx+rcx*2] |
| - | mov rax, [rbx+rcx*4] | + | mov rax, [rbx+rcx*4] |
| - | mov rax, [rbx+rcx*8] | + | mov rax, [rbx+rcx*8] |
| </ | </ | ||
| + | |||
| + | If any of the new registers (R8-R15) is used in the instruction, | ||
| + | |||
| + | <code asm> | ||
| + | ; | ||
| + | mov rax, [r10+rcx] | ||
| + | mov rax, [rbx+r11] | ||
| + | mov r12, [rbx+rcx] | ||
| + | |||
| + | ;Last instruction has the MOD R/M REG field extended | ||
| + | ;by the R bit from the REX prefix. | ||
| + | ; | ||
| + | ; | ||
| + | </ | ||
| + | |||
| + | Certainly, the presented examples do not exhaust all possible situations. For a more detailed explanation, | ||
| =====Displacement===== | =====Displacement===== | ||
| Displacement gives the offset for memory operands. Depending on the addressing mode, it can be the direct memory address or an additional offset added to the contents of the base, index register or both. Displacement can be 1, 2, or 4 bytes long. Some instructions allow using an 8-byte displacement. In these instructions, | Displacement gives the offset for memory operands. Depending on the addressing mode, it can be the direct memory address or an additional offset added to the contents of the base, index register or both. Displacement can be 1, 2, or 4 bytes long. Some instructions allow using an 8-byte displacement. In these instructions, | ||