Question: For each following, assume the Before values when the given instruction is executed. Give the requested After values. Notes: MOVZX adds leading zeroes (0) to
For each following, assume the Before values when the given instruction is executed. Give the requested After values.
Notes:
MOVZX adds leading zeroes (0) to fill up the destination storage
MOVSX adds copies of the sign in the source storage as leading values to fill up the destination storage.
XCHG: exchanges the values of the given pair of storage locations.
The Status Flags are set according to the result obtained: ZF: zero flag, SF: sign flag, OF: overflow flag, PF: parity flag
a); Before: EBX: FFEE FFDAH; ECX:ABCD 01F2H
MOV EBX, ECX;
; After: EAX, EBX, ECX, AH, AL, BH, BL, CH, CL
b); Before: EBX: FFBD 3ADCH; dValue: DWORD ?
4MOVZX dValue, BX ;
After: EBX, dValue, BX
c); Before: R15: E234 5678 ABCD EEFFH; wValue: WORD -17
MOVSX R15, wValue
; After: R15
d); Before: EBX: 1234 5678H; EDX: 9ABC DEF0H
XCHG BX, DX ;
After: EBX, EDX, BL, DL
e); Before: RAX: FAEA FADA FACA FABAH; RDX: 1525 1535 1545 1555H
XCHG EAX, EDX ;
After: RAX, EAX, R15, RDX
f); Before: EBX: FF00 FF95H; ECX: 0000 01B2H
ADD EBX, ECX ;
After: EBX, ECX, SF, ZF, CF, OF
g); Before: BX: FFB5H; CX: 02A2H
SUB CX, BX ;
After: BX, CX, SF, ZF, CF, OF
h); Before: CX: 031BH
INC CX
INC CL
DEC CX ;
After: CX, SF, ZF
i); Before: EBX: FFFF FFFEH
DEC EBX
DEC BX
DEC BL
DEC BH ;
After: EBX, SF, ZF
j); Before: RDX: FFFF FFFF FFFF FFFDH
NEG RDX ;
After: RDX, EDX, SF, ZF.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
