Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For each following, assume the Before values when the given instruction is execu

ID: 3605795 • Letter: F

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 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.

Explanation / Answer

a)

Before:

EBX - FF00 FF75       ECX – 000001F2

MOV EBX,ECX

After:

EAX -             000001F2        EBX - 000001F2        ECX – 000001F2

AH -    01                    BH - 01                       CH – 01

AL -    F2                    BL – F2                       CL – F2

b)

Before:                                                                                                                                               

EBX – FF00 FF75      dValue: DWORD

MOVZX         dValue,BX                              // Move with zero extension

DWORD means 4 bytes i.e. 32 bits

After:

EBX- FF00 FF75        dValue- 0000 FF75     BX- FF75

c)

Before:

R15 – 1515 1515 1515 1515              wValue – WORD       -15

MOVSX         R15W, wValue                       // Move with signed extension

WORD means 2 bytes i.e. 16 bits

- 15 = 1000 0000 0000 1111 = 800F              //signed binary representation

After:

R15 – FFFF FFFF FFFF 800F

d)

Before:

EBX – 1234 5678       EDX – 9ABC DEF0

XCHG                        BX,DX           //exchange data

After:

EBX - 1234 DEF0                 EDX – 9ABC 5678

BL – F0                                   DL - 78

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote