Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The control and memory unit of your CPU is in charge of processing the instructions that relate to flow control ( call , ret, jmp
The control and memory unit of your CPU is in charge of processing the instructions that relate to flow control call ret, jmp j cmp test and memory movements mov push, pop In srccmuc you will implement the following functions implement them in that order.
Callret note that the argument of the call instruction is relative to the current RIP, and indicates an byte signed displacement, ie if A is as a signed byte integer, then this call will remove from the RIP
Calls the function at address A In practice, this:
Pushes the current RIP cpustaterip onto the stack, ie decrease RSP
cpustateregsREGRSP by then store the RIP at the address
indicated by RSP
Add the byte signed integer A to the current RIP.
CORRESPONDING INSTRUCTION: call
void opcall cpustatet cpustate, uintt a
Returns from a function. In practice, this:
Sets the RIP to the byte integer at the top of the stack,
Increase RSP by
CORRESPONDING INSTRUCTION: ret
void opret cpustatet cpustate
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started