In the MOD part of the MOD_RM byte, it has four values for what the mode can be:
11
- Uses a register10
- 32-bit displacement01
- 8-bit displacement
From here: http://www.c-jump.com/CIS77/CPU/x86/X77_0060_mod_reg_r_m_byte.htm
The examples it gives are:
MOD R/M Addressing Mode
=== === ================================
00 000 [ eax ]
01 000 [ eax + disp8 ] (1)
10 000 [ eax + disp32 ]
I'm not quite sure I understand the difference between a 32-bit and 8-bit displacement. What would the following be examples of?
# sorry this is using ATT syntax not Intel
movb $1, (%eax)
movw $1, 2(%eax)
movl $1, (%eax, %eax)
movq $1, 2(%eax, %eax)
movq $1, 2(%eax, %eax)
movq $1, 2(%rax, %rdi)
movq $1, 2(%rax, %rdi, 4)
is 32- and 8-bit the size of the second register used in the memory address? If so, why does it not include a 16- or 64- bit displacement in the MOD
?