Rpn procedure, Computer Engineering

Apply this algorithm to your MASM program

1) Declare the following variables in your data segment:

.data

;

; 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
Differentiate between linear addressing and matrix addressing modes with examples. Ans: Linear Addressing: Addressing is the procedure of selecting one of the cells in a

Q. Explain Register Addressing Mode? Operand can be a 16-bit register: Addressing Mode Description Example AX, BX, CX, DX, SI,

Define Encapsulation- object-oriented technology Encapsulation also called as information hiding, is the characteristic of separating the external aspects of an object, from t

Artificial Intelligence Knowledge show (KR) is an area of artificial intelligence research aimed at showing knowledge in symbols to facilitate inferrencing from those knowledge ele

Explain the Significance of Binary Data Controlled devices generally contain registers that are made up of binary digits (bits). The following illustration shows how these regi

The PHP Hypertext Pre processor is a programming language that permits web developers to make dynamic content that interacts with databases. PHP is basically used for developing we

Use 4 D-bascules connected in serial all synchronized with the similar CLK. Then connect all 4 outputs, & 2nd output must reverse, of the D-bascule to an AND logic. The output of t

What are the difference between finite automata and Turing Machines?  Turing machine can alter symbols on its tape, while the FA cannot change symbols on tape.  Also  TM  has  a

General Concepts of links and association A link is a conceptual or physical connection among objects for instance. Mathematically, you can define a link as a tuple which is a

Weight Training Calculations -Artificial intelligence: Because we have more weights in our network than in perceptrons, first we have to introduce the notation: wij to denote t