
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

a) Load your program into the simulator and use breakpoints and single stepping to observe the operation of the TRAP Routines you used as pre-written subroutines.
b) Document your observations with some simulator snapshots. Of course, identify why you chose these snapshots and what the snapshots are displaying.
a) Define your stack to begin at xFE00.
b) Read and echo two one-digit hexadecimal numbers from the keyboard (with input message). They need to be small enough that the sum of them is still one hexadecimal digit.
c) Push the two hexadecimal numbers onto the stack using your subroutine which provides the PUSH and POP functions. (Your subroutine doesn’t have to check for overflow and underflow). The PUSH’ed or POP’ed value is passed using register R0.
d) Call another subroutine, call it ADD, which POPs the two hexadecimal numbers off of the stack, adds them, and PUSH’es the sum onto the stack.
e) Finally, your program will POP the sum from the stack and print it to the console (with labeling).
f) Load your program into the simulator and use breakpoints and single stepping to observe the operation of your program and subroutines.
g) Document your observations with some simulator snapshots. Of course, identify why you chose these snapshots and what the snapshots are displaying.