This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| en:multiasm:papc:chapter_6_6 [2026/02/19 20:42] – [MOD R/M byte] ktokarz | en:multiasm:papc:chapter_6_6 [2026/02/19 20:48] (current) – [Scale Index Base byte] ktokarz | ||
|---|---|---|---|
| Line 318: | Line 318: | ||
| <code asm> | <code asm> | ||
| ;MOD R/M (second byte) is 0x04 for all instructions: | ;MOD R/M (second byte) is 0x04 for all instructions: | ||
| - | ; MOD REG R/M | + | ; MOD REG R/M |
| - | | + | |
| ;SIB (third byte) is 0x0B, 0x4B, 0x8B or 0xCB: | ;SIB (third byte) is 0x0B, 0x4B, 0x8B or 0xCB: | ||
| - | ; Scale Index Base Scale Index Base | + | ; |
| - | mov eax, [ebx+ecx] | + | mov eax, [ebx+ecx] |
| - | mov eax, [ebx+ecx*2] | + | mov eax, [ebx+ecx*2] ;0x8B, 0x04, 0x4B 01 |
| - | mov eax, [ebx+ecx*4] | + | mov eax, [ebx+ecx*4] ;0x8B, 0x04, 0x8B 10 |
| - | mov eax, [ebx+ecx*8] | + | mov eax, [ebx+ecx*8] ;0x8B, 0x04, 0xCB 11 |
| </ | </ | ||
| Line 333: | Line 333: | ||
| <code asm> | <code asm> | ||
| ;REX prefix (first byte) is 0x48 for all instructions: | ;REX prefix (first byte) is 0x48 for all instructions: | ||
| - | ; | + | ; |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| ;MOD R/M (second byte) is 0x04 for all instructions: | ;MOD R/M (second byte) is 0x04 for all instructions: | ||
| - | ; MOD R.REG R/M | + | ; MOD R.REG R/M |
| - | | + | |
| - | ; Scale X.Index B.Base | + | ; |
| - | mov rax, [rbx+rcx] | + | mov rax, [rbx+rcx] |
| - | mov rax, [rbx+rcx*2] | + | mov rax, [rbx+rcx*2] ;0x48, 0x8B, 0x04, 0x4B 01 |
| - | mov rax, [rbx+rcx*4] | + | mov rax, [rbx+rcx*4] ;0x48, 0x8B, 0x04, 0x8B 10 |
| - | mov rax, [rbx+rcx*8] | + | mov rax, [rbx+rcx*8] ;0x48, 0x8B, 0x04, 0xCB 11 |
| </ | </ | ||
| Line 353: | Line 353: | ||
| <code asm> | <code asm> | ||
| - | ; Scale X.Index B.Base | + | ; |
| - | mov rax, [r10+rcx] | + | mov rax, [r10+rcx] |
| - | mov rax, [rbx+r11] | + | mov rax, [rbx+r11] |
| - | mov r12, [rbx+rcx] | + | mov r12, [rbx+rcx] |
| - | ;Last instruction has the MOD R/M REG field extended | + | ;Last instruction has the MOD R/M REG field extended |
| - | | + | |
| - | | + | |
| - | | + | |
| </ | </ | ||