Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago