Answered step by step
Verified Expert Solution
Link Copied!

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

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: 3

blur-text-image

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

8. How would you explain your decisions to the city council?

Answered: 1 week ago