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
Generic Techniques Developed: In the pursuit of solutions to various problems in the above categories, various individual fundamental techniques have sprung up which have been

What are latches and flipflops? There are two types of circuits as follows: a. Combinational b. Sequential Flipflops and latches both come into the category of "sequen

Process of Breadth first search: It's very useful to think of this search as the evolution of the given tree, and how each string of letters of word is found via the search in

What does the term convergence mean regarding E-commerce? Convergence regarding e-commerce: The capability to leverage and integrate the different data sources and proces

(a) When a forensic examiner arrives at a crime scene, the first task done is referred to as "Incident Response". Summarize the different incident response tasks done in 10 steps.

What is the difference among adding routes, to a webforms application and to an mvc application? Ans) To add routes to a webforms application, we use MapPageRoute() process of

Web authoring tools CGI was considered excellent in the beginning since it was also open standard. The only drawback it suffered was that it was slow. Major software developers v

What are the different connectivity options accessible to Internet Subscribers? Explain in detail. Internet Connectivity Options: Internet access is perhaps one of the ma

Does it makes sense for two domain name servers to contain exactly the same set of names? Why? Yes. This is very advantageous for two domain servers having similar set of names

Q. How to Apply Color and Style? 1.  In first text description layout cell, select heading text from the word "Fly" through the word "Mountains." 2.  In Property inspector,