Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need my MARIE program to output 0 if any number that is inputted is negative or 0, my code is pasted below INPUT STORE
I need my MARIE program to output 0 if any number that is inputted is negative or 0, my code is pasted below
INPUT STORE a OUTPUT INPUT STORE b OUTPUT INPUT STORE c OUTPUT
loop1, LOAD cnt ADD a STORE cnt Load b SUBT one STORE b SKIPCOND 400 JUMP loop1
loop2, LOAD d ADD cnt STORE d LOAD c SUBT one STORE c SKIPCOND 400 JUMP loop2 LOAD d OUTPUT HALT
a, DEC 0 b, DEC 0 c, DEC 0 d, DEC 0 one, DEC 1 cnt, DEC 0
END
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