Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9524205

Have any Question?


Related Questions in Computer Engineering

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

Recommend a mechanism that will record event data on the

Recommend a mechanism that will record event data on the folders for each department. What events should be logged and how often do these logs need to be reviewed? Recommend an implementation for antivirus software. Sugg ...

student who is taking quizzes public class student

/** A student who is taking quizzes. */ public class Student { private String name; private double totalScore; private int quizCount; public Student (String n) { name = n; totalScore = 0; quizCount = 0; } public String g ...

What are some of the uses of bayes theorem as in what type

What are some of the uses of bayes' theorem. As in what type of problems could I come across in a Biostatistics quiz

If you want to answer a research question regarding whether

If you want to answer a research question regarding whether a particular group of subjects experiences any significant changes in behavior as they age but you do not have the time or money for a traditional longitudinal ...

Relational algebrawrite a relational algebra expression

[Relational Algebra] Write a relational algebra expression that will output first name and last name of computer science major male students who have borrowed books from "University of Iowa Main Library". Relational Sche ...

Help me define corporate social responsibilityhelp me

Help me define corporate social responsibility. Help me conduct research on a Fortune 500 company and how do you determine just how (or if) the company ranks from a CSR perspective. Help me understand if the findings cha ...

A compare the properties of cpu registers with the main

(a) Compare the properties of CPU registers with the main memory in MIPS.  (b) Describe the purpose of the stack pointer ($sp) for procedure calling. (c) What is a "basic block" and how is it used by a compiler? (d) Ther ...

Question 1 programtoinput3examscores dropthelowestscore

QUESTION 1: Program to input 3 exam scores, drop the lowest score, and output the average of the remaining 2 scores. Question 2: program to input two integers from the user, and output every other integer in that range, ...

Candidate as pollster conducted a survey in which 450 out

Candidate A's pollster conducted a survey in which 450 out of 710 respondents indicated they would probably vote for Candidate A. Compute the confidence interval for the population.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As