Question: Question 1 options: The following program implements a stack that grows up toward low memory addresses as items are pushed, and the stack pointer points
Question options:
The following program implements a stack that grows up toward low memory addresses as items are pushed, and the stack pointer points to the top item on the stack.
AREA prog, CODE, READWRITE
ENTRY
LDR SPSTACK
MOV r #x
MOV r #x
PUSHR instruction
PUSHRinstruction
POPRinstruction
POPRinstruction
Loop B Loop
space
STACK DCD x
space
END
Using ONLY LDRSTR instructions:
Write one instruction instruction to push the value of R onto the stack.
Write one instruction instruction to push the value of Ronto the stack.
Write one instruction instruction to pop from the stack avalue and to save it in R
Write one instruction instruction to pop from the stack avalue and to save it in R
Make sure that the values of R and R are swapped after these operations.
What are the instructions you used?
Write your answer ie the instructions in TWO parts, the mnemonic in a box and ALL operands in another box.
To facilitate automatic marking,
Use CAPITAL letters ONLYexcept x make it a small letter.
Do NOT leave ANY spaces between operands.
The mnemonic of the st instruction is:
The operands of the st instruction are:
The mnemonic of the nd instruction is:
The operands of the nd instruction are:
The mnemonic of the rd instruction is:
The operands of the rdinstruction are:
The mnemonic of the th instruction is:
The operands of the th instruction are:
How many elements can be pushed onto this stack?
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
