Answered step by step
Verified Expert Solution
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 Z assembly language program to evaluate the following expression:
W X Y P Q
Use the attached LABasm 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 LABasm to assemble and execute the program.
The default output of the unmodified program file should show the following:
CS Lab #
W:
X:
Y:
P:
Q:
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 eightbit integers that is numbers up to ; 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 "hardcoded" into the program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started