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

Draw a circuit of TTL gates with Wired-AND connection, Draw a circuit of TT...

Draw a circuit of TTL gates with Wired-AND connection and explain its operation. Wired - AND Connection In digital IC's NAND and NOR gates are most frequently used. For th

Digital Design, Design a serial 2’s complementer with a shift register and ...

Design a serial 2’s complementer with a shift register and a flip-flop

Earned value analysis, Senior management has requested a status update on t...

Senior management has requested a status update on the workstation installation project.  As a part of this update, managers have requested that you present an Earned Value analysi

What is a structure, What is a structure? A structure is a collection o...

What is a structure? A structure is a collection of variables under a single name. These variables can be of different types, and each has a name which is used to select it fro

Recombination and mutation, Recombination and Mutation: In such a scen...

Recombination and Mutation: In such a scenario the point of GAs is to generate population after population of individuals that represent possible solutions to the problem at h

Local variables and global variables in lingo programming, Question: (a...

Question: (a) Differentiate between local variables and global variables in Lingo programming. (b) Using examples differentiate between deleteProp() and deleteAt() function

Explain the meaning of connect socket primitive, Explain the meaning of ...

Explain the meaning of CONNECT socket primitive. The connect Primitive: Clients utilize procedure connect to establish connection with an exact server. The form is

Balanced trees and their operations, what is ment by avl tree n insertion n...

what is ment by avl tree n insertion n deletion ,2-3 tress insertion n deletion

Illustrate the working of flip-flops, Q. Illustrate the working of FLIP-FLO...

Q. Illustrate the working of FLIP-FLOPS? A flip-flop is a binary cell that stores 1-bit of information. It itself is a sequential circuit. We know that flip-flop can change its

Define flash memory, Define Flash Memory. It is an approach same to EEP...

Define Flash Memory. It is an approach same to EEPROM technology. A flash cell is based on a one transistor controlled by trapped charge just like an EEPROM cell.

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