I want you to implement a reverse polish calculator in


Implement the following in MARIE.

Instructions

I want you to implement a reverse polish calculator in MARIE. This calculator must be implemented with or support the following requirements.

Stack-Based (not a fake stack, a true, potentially very, very large stack, stored below all the instructions and other variables)           

Proper subroutines using JNS calls for each "sub process" of your code 

All inputs and outputs must be in ASCII (not integer or decimal)

The ASCII inputs of +, -, *, /, %, and ^ should properly perform the corresponding integer arithmetic operations. These should operate stack based using RPN (i.e. the operation should pop the top two elements, perform the operation, then push the result back on the stack).         

  • +: A B + = A + B
  • -: A B - = A - B
  • *: A B * = A * B
  • /: A B / = A / B (integer division, no remainder) (e.g. 14 / 4 = 3)
  • %: A B % = A % B (modulus, ONLY the remainder of the division) (e.g. 14 % 4 = 2)
  • ^: A B ^ = AB (i.e. A raised to the B, or A multiplied by itself B times)

Each arithmetic operation should be implemented as a subroutine. You shouldn't need to worry about parameters, since the subroutine should access the stack pointer and pop the top two values itself.

ASCII letters will be input to execute command functions

  • c = Clears the stack
  • d = Duplicates the value on the top of the stack, pushing another copy of it
  • r = Reverses the order of the top two values on the stack
  • p = Prints the value on the top of the stack without modifying the stack (Peek command). Prints a blank line (or a space) after.
  • n = Prints the value on the top of the stack, popping it off. Prints a blank line (or a space) after.
  • f = Prints the entire stack, starting from the beginning (bottom) of the stack. Prints a blank line (or a space) after.
  • q = Exits the program.

Attachment:- Assignment File.rar

Request for Solution File

Ask an Expert for Answer!!
Assembly Language: I want you to implement a reverse polish calculator in
Reference No:- TGS02254558

Expected delivery within 24 Hours