|
Slide 6.3: Zero/sign extension of integers Slide 6.5: MOVSX instruction Home |
|
MOVZX Instruction
MOVZX instruction (move with zero-extend) copies the contents of a source operand into a destination operand and zero-extends the value to either 16 or 32 bits.| Zero Extension of an Integer | |
|---|---|
| Source (8 bits) | Destination (16 bits) |
1 0 1 0 1 0 1 0 |
0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 |
MOVZX — Move with Zero-Extend (386+) |
||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||
AX = SWORD |
EAX = SWORD |
EAX = BYTE |
|---|---|---|
.data var SWORD 0F1F0h .code mov eax, 0 movzx ax, var call WriteHex |
.data var SWORD 0F1F0h .code mov eax, 0 movzx eax, var call WriteHex |
.data var BYTE 0F0h .code mov eax, 0 movzx eax, var call WriteHex |
| Output | Output | Output |