Slide 4.10: MOV instruction Slide 4.12: General-purpose registers Home |
Operand | Description |
---|---|
reg |
An 8-, 16-, or 32-bit general register |
reg8 , reg16 , reg32 |
A general register, identified by its number of bits |
segreg |
A 16-bit segment register |
mem |
A memory operand, using any of the standard memory addressing modes |
mem8 , mem16 , mem32 |
A memory operand, identified by its number of bits |
accum |
AL , AX , or EAX |
immed |
An immediate operand |
immed8 , immed16 , immed32 |
An immediate operand, identified by its number of bits |
[offset]
: Dereferences the offset and obtains the contents of memory.
MASM normally treats X
same as the [X]
, where X
is a variable.
OFFSET
operator returns the offset of a data label.
An Immediate Operand | A Memory Operand | Dereference |
.code mov eax, -5000h call WriteHex |
.data X SDWORD -5000h .code mov eax, X call WriteHex |
.data X SDWORD -5000h .code mov eax, [X] call WriteHex |
Output | Output | Output |
Offset | Dereference | Offset then Dereference |
.data X SDWORD -5000h .code mov eax, offset X call WriteHex |
.data X SDWORD -5000h .code mov eax, [offset X] call WriteHex |
.data X SDWORD -5000h .code mov ebx, offset X mov eax, [ebx] call WriteHex |
Output | Output | Output |