Develop a calculator in masm, Computer Engineering

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.

Posted Date: 2/25/2013 1:55:35 AM | Location : United States







Related Discussions:- Develop a calculator in masm, Assignment Help, Ask Question on Develop a calculator in masm, Get Answer, Expert's Help, Develop a calculator in masm Discussions

Write discussion on Develop a calculator in masm
Your posts are moderated
Related Questions
Implementation of Arithmetic Circuits for Arithmetic Micro-operation  An arithmetic circuit can be implemented by a number of full adder circuits or parallel adder circuits. F

Question 1: Explain in detail the characteristics of the following artificial neural networks. (a) Recurrent Neural Networks. (b) Self-organising Mapping Neural Networks.

Considering the fact that a lot of research has been done concerning e-commerce, what has been brought in this work is that there has been a lot of facts, studies, and experiments.

how can I draw er diagram for sell & storage section of a drugstore?

Q. Describe the External Users of system? External Users: Modern information systems are now reaching beyond the boundaries of traditional business to involve customers and o

Different systems that can participate in grid computing as platform are:  Windows 3.1, 95/98, NT, 2000 XP , DOS, OS/2, , supported by  Intel ( x86); Mac OS  A/UX (Unix)  sup

Device Drivers in UNIX, MS-DOS and Windows System Though device drivers are in effect add-on modules they are however considered to be part of system because they are closely i

Q. Explain Segment Registers in bus interface unit? These are very significant registers of CPU. Why? We will answer this later. In 8086 microprocessor memory is a byte organiz

Performance metrics aren't able to attain a linear curve in comparison to increase in number of processors in parallel computer. The main reason for above situation is presence of

Intranets are mainly "small" Internets. They use same network facilities that Internet does, though access is restricted to a limited sphere. For example, a company can set up an i