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

How deep does fifo require to be stop underflow or overflow, Given the subs...

Given the subsequent FIFO and rules, how deep does the FIFO require to be to stop underflow or overflow? RULES: a. frequency(clk_A) = frequency(clk_B) / 4 b. per

Define edge triggered d flip flop, Define Edge Triggered D flip-flop? D...

Define Edge Triggered D flip-flop? D latch has only two inputs C(control) and D(data). The operation of a D flip-flop is a lot simpler and it has only one input addition to the

Unencoded micro-instructions, Unencoded micro-instructions One bit ...

Unencoded micro-instructions One bit is required for each control signal; so number of bits needed in a micro-instruction is high. It represents a detailed hardware vi

Explain basic cpu structure, A computer manipulates data consistent with in...

A computer manipulates data consistent with instructions of a stored program. Stored program means that the data and program are stored in same memory unit. Central processing unit

Explain design parameters, Explain the following design parameters S, ...

Explain the following design parameters S, SC, TC, C, CCI, EUF, K, T S The various terms are given below: S: Total number of switching components A good design sh

Give brief summary of common aspects found in spreadsheets, Give brief summ...

Give brief summary of common aspects found in spreadsheets -  It's made up of columns and rows; every row is identified by a number and every column is identified with a letter

Representation in prolog - logic programs, Representation in Prolog - Logic...

Representation in Prolog - Logic Programs : Artificial intelligence If we impose some more constraints on first order logic, then we get to a representation language known as l

How to make a datapool, When producing a datapool, you state the kinds of d...

When producing a datapool, you state the kinds of data (called data types) that the script will send for example, customer names, addresses, and unique order numbers or product nam

Formal analysis of visual elements, Formal Analysis: The second step o...

Formal Analysis: The second step of the art critiquing process often begins with an analysis of the artworks formal elements and how they are the organised. The formal elem

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