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

What is co-operative process, What is co-operative process? A process i...

What is co-operative process? A process is co-operating if it can affect or be affected by the other processes implementing in the system. Any process that share data with othe

Explain parameter passing in procedures, Q. Explain Parameter Passing in Pr...

Q. Explain Parameter Passing in Procedures? Parameter passing is a very vital concept in assembly language. It makes assembly procedures more general. Parameter can be passed t

Software characteristics, Software Characteristics: Software is en...

Software Characteristics: Software is engineered and developed. Software can't "wear-out". Most of the software continues to be routine built. The term in

Illustrate the purchase consummation activity, Illustrate the Purchase Cons...

Illustrate the Purchase Consummation activity? Purchase Consummation: This model lists three activities in the purchase consummation phase: • Receipt of product. • Pl

Relationship between distributed and mobile computing, a) Briefly describe...

a) Briefly describe the relationship between distributed computing, mobile computing and pervasive computing. b) Suppose the following scenario, which demonstrate the possibili

What is electronic data interchange, What is Electronic Data Interchange? ...

What is Electronic Data Interchange? Electronic Data Interchange (EDI): It is used by organizations for transactions which arise on regular basis to a pre-found format.

Describe data transfer instructions, Q. Describe Data Transfer Instructions...

Q. Describe Data Transfer Instructions? These instructions transfer data from one location in the computer to another location without altering the data content. Most common tr

What do you understand by hit ratio, What do you understand by Hit ratio? ...

What do you understand by Hit ratio? When a processor refers a data item from a cache, if the referenced item is in the cache, then such a reference is called hit. If the refer

State some of the uses of ms access, MS Access provides a vast range of fun...

MS Access provides a vast range of functions some of them are ? It is used by small business, departments of large corporations, and by amateurs to make applications on their d

C, Drawbacks of linear arrays

Drawbacks of linear arrays

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