Question: The following diagram shows stacks, variables, and code for two threads that switch via the yield 1 2 ( ) function. The code is written

The following diagram shows stacks, variables, and code for two threads that switch via the yield12() function. The code is written in CSx600 assembly language.sp1 andsp2 are the saved respective stack pointers for the two threads.
Assumptions & Clarifications
* All instructions and data are assumed to be 4 bytes
* PUSH X is equivalent to *(--SP)= X (pre-decrement)
* POP X is equivalent to X =*(SP++)(post-increment)
* CALL X is a single instruction equivalent to PUSH PC+4, JMP X
* RET is equivalent to POP PC
Starting with the stack pointer and program counter given above, the CPU will execute instructions until it reaches ---DONE--- with PC=0x50C.
Deliverable
For each of the instructions, give the following information:
1. Instruction address, i.e., the value of the program counter [PC]
2. The instruction at that address, i.e.,MOV SP ->*EAX)
3. Identify any registers or memory locations (give the specific addresses) that are modified by that instruction, and provide their new contents.
4. For any control flow instructions (JMP, CALL, RET) give the destination address, i.e.,0x704, RET: jump to 0x940, SP changes from 0x11FC to 0x1200
As an example, here's what the deliverable looks like for the first instruction:
1.314
2. "PUSH 0x800"
3.114->SP,318->PC,0x800->*0x114
 The following diagram shows stacks, variables, and code for two threads

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!