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
Classification of Systems Systems may be categorized as follows: a)  Formal or Informal b)  Abstract or Physical c)  Closed or Open d)  Automated orManual.

The Concept of Concurrent and Parallel Execution Real world systems are concurrent in nature and computer science is about modeling the real world. Illustrations of real world

Disadvantages of random scan display - Just by wire-frame, it is almost impossible to create images with shaded objects or areas filled with a given colour. - In case

A COCOMO model is :- COCOMO:- Constructive Cost Estimation Model.

How many types of stages include in process of data mining? The process of data mining comprised three stages as given below: a) The initial exploration b) Model buildin

Third Generation (1963-1972) The third generation introduced huge gains in computational power. Innovations in this time include use of integrated circuits or ICs (semiconducto

Explain Big - Endian and Little- Endian representations Ans: The Big- endian is used where lower byte addresses are used for the more significant bytes (leftmost bytes) of the

The larger the Grade of Service, the worse is the service given, it is true or false. Ans: It is true that larger the Grade of Service, the worse service is provided.

Is the TCP checksum necessary? Yes, TCP Checksum is essential. TCP layer is liable for error detection, transmission of packets if needed, error control, reassembly of packe

Question: (a) (i) Explain properties of the WebService attribute. (ii) Discuss three properties of the WebMethod attribute. (b) What are WSDL documents used for? (c)