How can the MARIE processor be used to count the number of zeroes in user input?

  • Thread starter Thread starter twoski
  • Start date Start date
  • Tags Tags
    Programming
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
1 reply · 3K views
twoski
Messages
177
Reaction score
2

Homework Statement



Write a MARIE program that repeatedly receives a sequence of decimal digits (one digit at a time) and counts the number of occurrences of ‘0’ and stores it in memory location Count until a non-digit is received. Assemble and run your program using the MARIE simulator

Homework Equations



http://www.edwardbosworth.com/CPSC2105/Lectures/Slides_05/Chapter_04/MARIE_Organization.htm

The Attempt at a Solution



I start with reading user input, but how do i check how many zeroes are in the input if i can only add/subtract values?
 
Physics news on Phys.org
twoski said:
I start with reading user input, but how do i check how many zeroes are in the input if i can only add/subtract values?
The MARIE processor also has a SKIPCOND instruction, how could you make use of that?