Rpn procedure, Computer Engineering

Assignment Help:

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.


Related Discussions:- Rpn procedure

Describe the limitation of fat16, Q. Describe the Limitation of FAT16? ...

Q. Describe the Limitation of FAT16? DOS designers decided to use clusters with as a minimum four sectors in them (so a cluster size of at least 2KB) for all FAT16 hard disks.

What do you meant by a storage device, Question : (a) What do you me...

Question : (a) What do you meant by a storage device? (b) List 5 examples of storage devices and give their uses (c) What are the differences between backup and ar

Find minimal expression for sop. draw gate network, Q Consider the followin...

Q Consider the following expression. Assume that complement inputs are available. F(A,B,C,D) = ∑m (1,2,6,9,10,14) + ∑d (4,7,8,11,12) a. Find minimal expression for SOP. Draw

Dbms, What is meant by concurrent execution of database transactions in a m...

What is meant by concurrent execution of database transactions in a multi user system

Detemine the major building blocks of uml, Detemine the major building bloc...

Detemine the major building blocks of UML UML could be used in visualizing, specifying, constructing and documenting object oriented systems. The major building blocks of UML a

What is python?, Python is an interpreter, interactive, object-oriented pro...

Python is an interpreter, interactive, object-oriented programming language. It is frequently compared to Tcl, P e r l, Scheme or Java. Python combines remarkable power with v

What are the different methods of passing data, What are the different meth...

What are the different methods of passing data? There are three different methods of passing data Calling by reference    Calling by value Calling by value and result

What is reentrant tasks and functions, What is reentrant tasks and function...

What is reentrant tasks and functions Tasks and functions without optional keyword automatic are static , with all declared items being statically allocated. These items will b

Discuss the process of data mining, Discuss the process of data mining? ...

Discuss the process of data mining? The process of data mining having of three stages: (1)The initial exploration (2) Model building or pattern identification with validat

Concept of pipelining, Describe the concept of pipelining. Ans: Pipeli...

Describe the concept of pipelining. Ans: Pipelining is the means of executing machine instructions concurrently. This is the effective way of organizing concurrent activity in

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