Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Z 8 0 assembly language program to evaluate the following expression: W = ( X + Y P + Q ) Use the

Write a Z80 assembly language program to evaluate the following expression:
W =(X + Y P + Q)
Use the attached LAB02.asm program file as a starting point. Download this file to your workstation and copy it into your "TASM / MAME Toolkit" folder. Drag and drop the file onto the TASMMAME.cmd script file to assemble the program, open the emulator, and execute the program. Or, open a Command Prompt window, set the current working directory to the root of your "TASM / MAME Toolkit" folder, then enter the command tasmmame LAB02.asm to assemble and execute the program.
The default output of the unmodified program file should show the following:
CS 333 Lab #2
W: 0
X: 0
Y: 0
P: 0
Q: 0
W =(X + Y - P + Q)
This indicates that all five program variables have been initialized to zero. (The original expression is also printed for your reference.)
Open the program file for editing with a suitable text editor, such as Visual Studio Code. Look for the INSERT YOUR CODE HERE comment block in the program file; this is where you should begin adding your instructions to complete the program. The other code that is already provided in the file should not be changed.
Start by assigning new values to the variables X, Y, P, and Q. You may choose any values you wish, but they must be unsigned eight-bit integers (that is, numbers up to 255); because these values are unsigned, you should also choose values that will cause the expression to evaluate to a positive result. This can be done by loading the new values into the accumulator, and then loading the accumulator into the variable using direct addressing mode. Next, supply the instructions which will evaluate the given expression and compute the final value of W.
Assemble and run your program to test your results; when you are finished, confirm that the value of W has been computed correctly, given the initial values you chose for the other variables. (Your program must actually compute this value! No credit will be given for submissions in which this value has been determined in advance and "hard-coded" into the program.)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

3. What is the goal of the continuous flow phase?

Answered: 1 week ago