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 yield function. The code is written in CSx assembly language.sp andsp are the saved respective stack pointers for the two threads.
Assumptions & Clarifications
All instructions and data are assumed to be bytes
PUSH X is equivalent to SP X predecrement
POP X is equivalent to X SPpostincrement
CALL X is a single instruction equivalent to PUSH PC 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 PCxC
Deliverable
For each of the instructions, give the following information:
Instruction address, ie the value of the program counter PC
The instruction at that address, ieMOV SP EAX
Identify any registers or memory locations give the specific addresses that are modified by that instruction, and provide their new contents.
For any control flow instructions JMP CALL, RET give the destination address, iex RET: jump to x SP changes from xFC to x
As an example, here's what the deliverable looks like for the first instruction:
"PUSH x
SPPCxx
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
