use maries isa program a stack structure for


Use MARIE's ISA program a stack structure for unsigned integers.

Stack

You should write three subroutines for the stack: peek, push, and pop. The location of the stack is between locations 600 and 700.

  • push function should take a parameter and push it into the top of the stack. You should move all the items currently in the stack down one position. If the stack is full, your program should return -1. This is the stack overflow error.
  • pop function should return a parameter and it is the value on the top of the stack. You should move all the items currently in the stack up one position. If the stack is empty befor the pop, you should return a -1.
  • peek function will return the value of the top of the stack. No action is needed on the data of the stack. If the stack is empty, you should return -1.

It will be helpful if you use a variable to keep a record of how many data are currently in the stack.

Write a program to push 10 items into your stack, and pop them out.

Request for Solution File

Ask an Expert for Answer!!
Assembly Language: use maries isa program a stack structure for
Reference No:- TGS0485889

Expected delivery within 24 Hours