Rpn procedure, Computer Engineering

Apply this algorithm to your MASM program

1) Declare the following variables in your data segment:



; These are the values of the variables


Variables               DWORD         17                                            ; A

DWORD         12                                            ; B

DWORD         4                                              ; C

DWORD         10                                            ; D

DWORD         5                                              ; E


; This is the expression to evaluate . . .


Expression BYTE              "AB-C*DE-/"                                      ; expression to evaluate

2) Create two procedures.  The first procedure should be the RPN calculator and is called from your main program procedure.  The parameters you pass to the RPN procedure from the main program are:

a) The address of the source RPN string.

b) The address of your variables list.

c) The length of our source RPN string.

You may choose any registers to use for passing parameters. The RPN procedure returns the calculated result in the EAX register. The RPN procedure must use the stack as discussed in Chapter 5 to compute the result.

3) The second procedure is called from your RPN procedure.  It determines if the character the RPN procedure is looking at is a variable or operator.  The parameters you pass to the second procedure are:

a) The character being examined.

b) Return code in EAX.  Zero if a variable, one if an operator.

4) Both procedures should be called using the CALL instruction ONLY.

5) When processing the RPN expression, your variable references should map to the variables array.  In other words, your program logic should locate the first DWORD value in the variables list from the letter "A", the second DWORD value from the variable "B", and so on.  You CANNOT hardcode numeric values in the RPN string!

6) Create a second set of variables and an associated RPN string of your choosing.  The second set must consist of AT LEAST four variables.  I can provide examples if you need them.

7) Run your program ONCE with both sets of variables and RPN strings.  Your main program should call the RPN procedure once with the first string, then a second time immediately thereafter with the second string.  Save both results in your data segment.

8) Your main program and all procedures should be in the same .asm file.

9) Submit the following for grading:

a) Your source code (softcopy).

b) A listing of your source code and a memory dump showing the results of both calls to the RPN procedure.

Posted Date: 2/25/2013 1:58:02 AM | Location : United States

Related Discussions:- Rpn procedure, Assignment Help, Ask Question on Rpn procedure, Get Answer, Expert's Help, Rpn procedure Discussions

Write discussion on Rpn procedure
Your posts are moderated
Related Questions
What is the significance of XML in EDI and electronic commerce?   XML has been defined as lightweight SGML XML shows great promise for its inherent ability to permit a " doc

Q. Define COM Programs? A COM (Command) program is binary image of a machine language program. It is loaded in memory at the lowest available segment address. Program code star

A Master group consists of? A master group have 300 voice channels.

Q. What is Associative Mapping Cache? The most fastest and flexible cache organization employs an associative memory that is displayed in Figure below. The associative memory s

Explain Open source software? Open Source Software is software for which the underlying programming code is available to the users so that they might be read it, make changes t

Problem (a) Using a labelled diagram of an Instruction-Execution cycle, describe how a CPU executes single machine instructions by referring to the five main operations.

Associative Mapping: It is a more flexible mapping technique A primary memory block can be placed into any specific cache block position. Space in the cache may be

Explain the Storage Class Static The Storage Class Static : Static declarations have two important and distinct uses. The more elementary use is to allow a local variable to

What do they signify Which one is critical for calculating maximum clock frequency of a circuit? Ans) Set up time constraint implies how late the input signal can arrive befor

Pipelined Processor Having discussed pipelining; now we can describe a pipeline processor. A pipeline processor can be distinct as a processor that consists of a series of proc