Question: Hello, I keep getting error with my program on Marie language. I t keep giving m e a syntax error. The < - i s

Hello, I keep getting error with my program on Marie language. It keep giving me a syntax error. The <-isan arrow. Here the assignment: Using the MARIE computer assembly language, write a program that computes the following expression:
z <-(a * b)+(c * d). The computer will read in the input values a, b, c, and d from the keyboard, the final
result (z) has to be displayed. In addition, every time an input value is read in, it must be validated by
checking that the input is a positive number. If it is positive display the number on the screen; otherwise
display zero and end the program. Remember that the MARIE instruction set does not have an instruction
to execute multiplication.
Here ismy code: // Variables and Constants
InputA, DEC 0// Variable to store input a
InputB, DEC 0// Variable to store input b
InputC, DEC 0// Variable to store input c
InputD, DEC 0// Variable to store input d
ResultZ, DEC 0// Variable to store the result z
Zero, DEC 0// Constant representing zero
// Start of the program
Start, INP // Input a
SKIPCOND 800// Check if input is positive
JUMP InputError // Jump to InputError if input is not positive
STO InputA // Store input in InputA
OUT // Display the input
INP // Input b
SKIPCOND 800// Check if input is positive
JUMP InputError // Jump to InputError if input is not positive
STO InputB // Store input in InputB
OUT // Display the input
INP // Input c
SKIPCOND 800// Check if input is positive
JUMP InputError // Jump to InputError if input is not positive
STO InputC // Store input in InputC
OUT // Display the input
INP // Input d
SKIPCOND 800// Check if input is positive
JUMP InputError // Jump to InputError if input is not positive
STO InputD // Store input in InputD
OUT // Display the input
LDA InputA // Load InputA into accumulator
MUL InputB // Multiply accumulator with InputB
STO ResultZ // Store result of first multiplication in ResultZ
LDA InputC // Load InputC into accumulator
MUL InputD // Multiply accumulator with InputD
ADD ResultZ // Add result of second multiplication to ResultZ
OUT // Display the final result
HLT // Halt the program
// Input error handling
InputError, LDA Zero // Load 0 into accumulator
OUT // Display 0
HLT // Halt the program
// End of program
END Start

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!