Question: Project 1-3, ASM, and Context Switch The table below illustrates a memory state where code pieces similar to part-3 of project 1 are loaded. For

 Project 1-3, ASM, and Context Switch The table below illustrates a

Project 1-3, ASM, and Context Switch The table below illustrates a memory state where code pieces similar to part-3 of project 1 are loaded. For example, the code at Ox0000 implements switch_to(void ** loc_for_old_sp, void *new_sp) function where the 1st argument is at ESP+4 and the 2nd argument is at ESP+8. /* Siceh_co/ 0x0000 MOV EAX, CES? - Ox00041 0x2000 PUS COD0041 0x0004 NOV (EAXI, ES? 0x4018 0x2004 USE OXD000 0x2008 CALL 00000 0x0008 MOV ESP, ESP - 0x00081 0x0000 RET 0x2000 EALS 0x0010 EALT 0x5014 OXOFFS MOV [0x0001. Ox3014 0x2000 PUSX (OXD0081 0x7014 0x3004 PUSE OXD004 OXOFEC MOV [Ox50141, 0x2000 0x1000 MOV [OXD0041, 0x5014 0x1004 MOV [0x60241, 0x2000 0x3008 CALL 00000 0x3000 HALS DxD000 0x1008 MOV [OXD0081, 0x7014 DxD004 Cx1000 PUSH COXD0001 DxD000 Dx2010 PUSE OXD008 Cx1014 CALL 00000 0x1018 HALS Here is some information to understand the assembly syntax. . You may assume all hexadecimal numbers are 4 bytes and all registers and memory accesses through the assembly instructions happen in a 4-byte granularity. Push/pop changes ESP by 4. ESP: stack pointer register. EIP: instruction pointer register. EAX, EBX: general purpose registers. . [X]: accesses the value in memory location X. MOV X, Y: copies Y into X. PUSH X: pushes X to the stack. POP X: pops the top element of the stack and stores it into X. CALL X: pushes the return address to the stack and jumps to X. RET: pops the return address from the stack and jumps to the return address. HALT: stops execution The system starts with ESP=0x4018 and EIP=OxOFF8 and executes the instructions until EIP reaches a HALT instruction. Follow the execution line by line and list all changes to the memory and the ESP register in the execution order in a space separated format "INS MEM ADDR MEM VAL ESP_VAL". If the EIP value jumps le.g., due to CALL or RET instruction, then add a blank line

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!