Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) Use the following data definitions for this question, and assume that the logical address of the first element of myBytes is 000040h. myInts DWORD

1) Use the following data definitions for this question, and assume that the logical addressof the first element of myBytes is 000040h.

myInts DWORD 1abch, 268ah, 3579h

Indicate the hexadecimal value of the destination operand after the instruction is executed, next to each instruction. Use the letter I to indicate that a particular instruction is illegal:

i) mov al, offset myBytes

;al =

ii) mov al, 00101100

;al =

iii) mov al, SIZEOF myInts

;al =

iv) mov al, BYTE PTR [myInts+3]

;al =

2) Answer each of the following questions as appropriate.

i) The initial value in ESP is 12FF8Ch. What will be the new value in ESP after executing the instruction pushad?

ii) Indicate the values in the following flags after executing the instruction xor ax, ax.

SF = ZF =

iii) Consider data declaration: Arr1 DWORD 7 DUP (3), 0, 0. Indicate the values returned by the following operators a) TYPE Arr1 b) LENGTHOF Arr1 c) SIZEOF Arr1.

iv) The statement count = 500 allocates ___________ bytes of storage in memory.

v) Indicate the error (if any) in the following instruction: mov ds, 1234h.

3) For each of the following tasks, write a singleinstruction to accomplish the task:

i) Increment the byte (in memory), whose logical address is in register ESI.

ii) Take the contents on the top of the stack (pointed to by ESP) and move it to register EIP.

iii) Take the most significant two bytes of a quadword integer (int1), and copy them to the lower two bytes of the EAX register.

4) i) For each of the following questions, use the data declaration given below and answer as appropriate. val1 WORD 1, 2, 3, 4

a) The above data declaration allocates ____________ bytes in memory.

b) After executing the instruction mov eax, DWORD PTR [val1+2], the contents of register eax (in hexadecimal) is: ________.

ii) Explain index operands and scaling using an example.

5) Indicate the values (in hexadecimal) in the appropriate registers and on top of stack ( [esp]), after the corresponding instructions have been executed. Assume the initial value in the stack pointer is esp = 0054ff64h.

Include Irvine32.inc

.data

v1 DWORD 778812h

v2 DWORD 556696fah

.code

main PROC

mov eax, 123456h

push v2

; esp = [esp] =

push v1

; esp =

call myProc

mov ebx, eax

; ebx =

mov ecx, v2

; ecx =

exit

main ENDP

myProc PROC

Add v1,1

ret

myProc ENDP

END main

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Publishing With Filemaker Pro On The Web

Authors: Maria Langer

1st Edition

0201696657, 978-0201696653

More Books

Students also viewed these Databases questions

Question

2. Record these without judgments, criticisms, or comments.

Answered: 1 week ago