Develop a calculator in masm, Computer Engineering

Assignment Help:

Assignment:  develop a calculator in MASM.

Text chapters covered:  1 through 4, 5.4, 5.5, 6.3, 7.4

You will develop a "calculator" algorithm in MASM using reverse-polish notation (RPN).  RPN is an extremely useful technique to calculate algebraic expressions.  It is used by many compilers to process algebraic statements.  Your calculator will evaluate RPN expressions using INTEGER values only.

RPN is a postfix expression, meaning that the operation (add, subtract, etc.) follows the variables.  Contrast this to an algebraic expression where the operations are situated between the variables (this is called infix notation).  Here's an example of an RPN expression and its algebraic equivalent:

                        Algebraic equation:     E(A+B)/C-D

                        RPN equivalent:          AB+E*CD-/

To compute an RPN expression is a straightforward process using stacks.  Assume that the RPN expression is always presented as a character string.  The algorithm to do this is shown below.

1. If the character encountered is a variable, push the variable on the stack.

2. If the character encountered is a operator (+,-,*,/), pop the top two variables off the stack, perform the operation on them, then push the result back on the stack.

3. Continue steps 1 and 2 until the string is exhausted.  The last value on the stack is the final result.


Related Discussions:- Develop a calculator in masm

Explain erasable programmable rom (eprom) - computer memory, Explain Erasab...

Explain Erasable Programmable ROM (EPROM) - Computer Memory? An EPROM is a ROM that can be reprogrammed and erased. A little glass window is installed at the top of the ROM pac

What is knowledge representation and reasoning, Artificial Intelligence Kno...

Artificial Intelligence Knowledge show (KR) is an area of artificial intelligence research aimed at showing knowledge in symbols to facilitate inferrencing from those knowledge ele

State disadvantages of object oriented analysis design, State Disadvantages...

State Disadvantages of object oriented analysis design You know that OO methods only create functional models within objects. There is no place in methodology to design a compl

Personal computing environment, Reply and discuss the role of the SAS 70 re...

Reply and discuss the role of the SAS 70 report in reviewing internal controls. Provide publicly available examples of SAS 70 reports and explain. Problem Discuss the

What is serial mouse, Q. What is Serial Mouse? Mice that use standard s...

Q. What is Serial Mouse? Mice that use standard serial port are known as 'serial'. Because Serial ports 1 and 4 (COM1, COM4 under DOS, /dev/ttyS0 and /dev/ttyS3 under Unix/GNU-

Explain how viewstate is being formed, Explain how Viewstate is being forme...

Explain how Viewstate is being formed and how it is keeps on client. The type of ViewState is System.Web.UI.StateBag, which is a dictionary that keeps name/value pairs. View St

What will be its digital output of an 8-bit ADC, An 8-bit successive approx...

An 8-bit successive approximation ADC has a resolution of 20mV.  What will be its digital output for an analog input of 2.17V? Ans: Given data Resolution =20mv Analog input =2.

How to create a bugzilla account? , 1. Enter your "E-mail address...

1. Enter your "E-mail address" and "Real Name" (or whatever name you need to call yourself) in the spaces given, then select the "Create Account" button. 2. Within moments, you

Describe the analytical engine by babbage, THE ANALYTICAL ENGINE BY BABBAGE...

THE ANALYTICAL ENGINE BY BABBAGE: It was general use computing device that could be used for performing any types of mathematical operation automatically. It contains the follo

Handlers classification, Handler's Classification In 1977, Wolfgang Han...

Handler's Classification In 1977, Wolfgang Handler proposed an detailed notation for expressing the parallelism and pipelining of computers. Handler's classification addresses

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd