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. keep giving a syntax error. The arrow. Here the assignment: Using the MARIE computer assembly language, write a program that computes the following expression:
z a bc 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 code: Variables and Constants
InputA, DEC Variable to store input a
InputB, DEC Variable to store input b
InputC, DEC Variable to store input c
InputD, DEC Variable to store input d
ResultZ, DEC Variable to store the result z
Zero, DEC Constant representing zero
Start of the program
Start, INP Input a
SKIPCOND 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 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 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 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 into accumulator
OUT Display
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
