Question: Write the following code example of using stack try to understand it , ensure to include the missing two lines of code submit screen shot
Write the following code example of using stack try to understand it ensure to include the missing two lines of code submit screen shot of working code and submit example.s file
An Example of Using Stack
data
EQU stackloc, x Initial Main Stack Pointer Value
function:
write your code Save values in the stack of R and link register onto the stack
MOV R # Set initial value for the delay loop
delay:
SUBS R R #
BNE delay
write your code pop out the saved value from the stack,
user main program
global start
start:
LDR SPstackloc
MOV R #x
MOV R #
PUSH R R Notice the stack address is xFF
MOV R #
MOV R #
write your code Should be able to see R #x and R # after pop
Loop:
ADD R R#
CMP R #x
BNE Loop
MOV R # prepare for function call
BL function
MOV R#
stop:
B
stop
end
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
