Question: Consider a service routine that responds to a timer interrupt. Assume that the function of this service routine is simply to increment the current value
Consider a service routine that responds to a timer interrupt. Assume that the function of this service routine is simply to increment the current value of ``clock''-- an integer stored in absolute address CLOCK. Ignore any overflow that may arise from this operation.
Below is a pseudo code for this service routine. Pseudo code of the service routine
----------------------------------
Load CLOCK, R1 (* loads the integer stored in address CLOCK to register R1 *)
INCREMENT R1 by 1
STORE R1, CLOCK (* stores the value in R1 to the memory location CLOCK *)
RETURN (* Pops the return address from control stack and loads it to PC *)
Questions:
(a) Point out any problems with this code, in less than 30 words.
(b) Show a corrected pseudo code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
