Show the contents in hexadecimal form 0x of the memory locat

Show the contents (in hexadecimal form 0x...) of the memory location indicated after the instruction has been completed. Assume that the program addresses given are valid addresses for the instructions. Indicate the contents of the following memory locations AFTER line 2 has been executed. Indicate the contents of the following memory locations AFTER line 9 has been executed.

Solution

Given the content before execution:

Line 2 has a call instruction, which transfers control to the subroutine called, return address i.e IP is pushed to stack. Line to doesnot change the contents of RAM 0x027A: 0x027F. thus:

Program has nop instruction which do nothing, only increments the instruction pointer(IP).

JMP instuction will go to the specified address. It will not copy the current address to stack, so contents of the stack poiter (SP) is only changed after Call instruction.

Line9 has a RET instruction which return the control to caller, pop the address from the stack.

Contents of the Memory before Line 1 has been executed
RAM 0x01
0x27F 0x01
0x27E 0x23
0x27D 0x45
0x27C 0x67
0x27B 0x89
0x27A 0xAB
PC 0xF828
SP 0x0280
 Show the contents (in hexadecimal form 0x...) of the memory location indicated after the instruction has been completed. Assume that the program addresses give

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site