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
The typicality of virtual addresses is that: They are longer than physical addresses because total addressed memory in virtual memory is more than actual physical memory.

What are the Advantages of store program control (I) Easy to maintain (II) Easy to control (III) Wide range of services can be provided to customers (IV) Flexible

Explain the relationship amongst Translated address and Linked address. Translated address: Address assigned through the translator Linked address: Address assigned

You can't plan only for the present phase of the project as your future activities are still coarse granular. To have good planning you require to have fine granularity w.r.t the t

This comes at the complication time, If we give the LOGO option to the compiler, it take a bitmap file (i.e., ) as logo previous to loading the Application.

An operating system contains 3 user processes each requiring 2 units of resource R. The minimum number of units of R such that no deadlocks will ever arise is? Ans. The minimum

Determine the registers are available in machines Typical registers, some of which are commonly available in machines. These registers are as follows:- Memory Addres

Q. Illustrate working of Magnetic Bubble Memories? In many materials like garnets on applying magnetic fields certain cylindrical areas whose direction of magnetization is oppo

What are the characteristics and features of Client/Server Computing? Several of client/server computing architecture is listed below: a. It comprises a networked webs of sm

Execute the following functionality using Java & SQL with simple GUI interface: 1.  Insert/delete/update an XML document.  2.  Insert/delete/update a category.  3.  Alloca