Question: We use CodeWarrior program assembly: Using a loop, branches, and the stack, create a postfix notation calculator that performs the operations specified in RPN_IN. Add

 We use CodeWarrior program assembly: Using a loop, branches, and the

We use CodeWarrior program assembly: Using a loop, branches, and the stack, create a postfix notation calculator that performs the operations specified in RPN_IN. Add the variables below to the DATA section of your code. Use these variables to implement your calculator. The variable OPER contains the ASCII representation of the operators (addition, subtraction, multiplication, and division) in HEX. Use this variable in the loop to determine what operation to perform. RPN_IN contains the variable with the operation to perform. The values in RPN IN below are initially 63/4*2+ and the result should be 10. Try another operation of your choosing by changing RPN IN and discuss it in the methodology section of your report FCB $06,$03,$2F, $04,$2A, $02,$2B 63/4*2+=10 RPN IN RPN OUTRMB ; RPN START FDB RPN END FDB RPN IN RPN OUT-1 ; Pointer to start of RPN array Pointer to end of RPN array OPER FCB $2A,S2B, $2D,$2F HINTS: You will traverse the RPN IN array in a similar fashion to lab 3. You will jump out of the array when an operator is found, pull two values off the stack, perform that particular operation, push the result onto the stack, and then return to the loop. Otherwise, you will just push the value on the stack. NOTE: the divide instruction (IDIV) requires two 16-bit registers and returns a 16-bit value. Only return the lower 8-bit as your result. We use CodeWarrior program assembly: Using a loop, branches, and the stack, create a postfix notation calculator that performs the operations specified in RPN_IN. Add the variables below to the DATA section of your code. Use these variables to implement your calculator. The variable OPER contains the ASCII representation of the operators (addition, subtraction, multiplication, and division) in HEX. Use this variable in the loop to determine what operation to perform. RPN_IN contains the variable with the operation to perform. The values in RPN IN below are initially 63/4*2+ and the result should be 10. Try another operation of your choosing by changing RPN IN and discuss it in the methodology section of your report FCB $06,$03,$2F, $04,$2A, $02,$2B 63/4*2+=10 RPN IN RPN OUTRMB ; RPN START FDB RPN END FDB RPN IN RPN OUT-1 ; Pointer to start of RPN array Pointer to end of RPN array OPER FCB $2A,S2B, $2D,$2F HINTS: You will traverse the RPN IN array in a similar fashion to lab 3. You will jump out of the array when an operator is found, pull two values off the stack, perform that particular operation, push the result onto the stack, and then return to the loop. Otherwise, you will just push the value on the stack. NOTE: the divide instruction (IDIV) requires two 16-bit registers and returns a 16-bit value. Only return the lower 8-bit as your result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!