MOVSX Instruction
| Sign Extension of an Integer | |
| Source (8 bits) | Destination (16 bits) |
0 1 0 1 0 1 0 1 |
0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 |
1 0 1 0 1 0 1 0 |
1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 |
MOVSX — Move with Sign-Extend (386+)
|
||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
AX = BYTE
|
SDWORD = SWORD
|
SWORD = SDWORD
|
INCLUDE Irvine32.inc .data var BYTE 0F0h .code main PROC mov eax, 0 movsx ax, var call WriteHex exit main ENDP END main |
||
| Output | Output | Output |
| -3600 | 0FFFFF123h |
|
“A guy goes ice fishing for the very first time. All of a sudden, he hears a voice. “There are no fish under the ice!” He ignores it and moves to another area, cuts a hole and tosses his line in. Again, he hears the booming voice: “There are no fish under the ice!” He nervously looks up and asks, “Lord? Is that you?” “No, this is the rink manager!” ― Emmy Award-winning actress Allison Janney |