What is the result of each of the instructions listed below

What is the result of each of the instructions listed below? Assume that the instructions execute in sequence in other words, the result of each instruction may depend on the results of earlier instructions. Correctly evaluating each instruction will earn you 10 points. Note that you may assume any constant values shown using less than 32 bits are zero-extended to 32 bits if necessary (for example, 0x000F = 0x0000000F) MOV DL, 0xFE MOV DH, AL MOVSX BX, BYTE PTR [ESI+0x000F] MOV [EDI+ECX], EBX MOV [ESI+4astirECX], AX XCHG CL, [ESI] MOVZX EAX, WORD PTR [EDI-HECXI MOV DX, [EDIT+0xFFFFFFFA] LEA ECX, [ESI+EBX +0x0017] MOVSX EBX, BYTE PTR [ESI+4]

Solution

1. This instruction moves the 0xFE to DL register which is 8 bits in size. Now,DL=0xFE

2. This instruction moves the content of AL register to DH register.Now,DH=0x70

3.This instruction moves the first byte of [0x00020100+0x000F] to BX.Now contents of EBX=0x00000003

4.This instruction first add the contents of EDI and ECX and then moves the content of EBX to the memory location (addition of EDI and ECX)

After this execution memory location 0x00020112 contains 0x00000003.

5.This instruction scales the content of ECX by 4 and added this value to ESI.And then contents of AX which is 0x3170 moved to the calculated location.

6.This instruction exchage the content of CL register with the first byte of of location pointed by ESI.

After this ECX=0x00000010 and [ESI]=02000800.

7.This is zero extended instruction.This instruction moves the first 16 bit of [0x00020110+0x00000002] location to EAX.Now EAX contains 0x00000000

8.This instruction moves the contents of[0x00020110+0xFFFFFFFA] to DX.

9.LEA is load effective address. This instruction stores the actual memory address [0x00020100+0x00000001+0x00000017] to the ECX

10.This is sign extended instruction. This instruction moves the first byte of location 0x00020104 to the EBX. Now EBX=0x00000010

 What is the result of each of the instructions listed below? Assume that the instructions execute in sequence in other words, the result of each instruction ma

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site