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
Click For Summary
SUMMARY

The MARIE processor can be programmed to count the occurrences of the digit '0' in user input by utilizing its assembly language features. The program reads decimal digits one at a time and employs the SKIPCOND instruction to determine when a non-digit is encountered. The count of '0's is stored in the memory location designated as Count. This approach effectively combines input handling with conditional logic to achieve the desired functionality.

PREREQUISITES
  • Understanding of MARIE assembly language syntax
  • Familiarity with the MARIE simulator for program execution
  • Knowledge of memory addressing in MARIE architecture
  • Basic concepts of conditional instructions, specifically SKIPCOND
NEXT STEPS
  • Explore MARIE assembly language programming techniques
  • Learn how to implement input handling in MARIE
  • Study the use of SKIPCOND for conditional branching in assembly
  • Investigate memory management and storage in the MARIE processor
USEFUL FOR

Students learning assembly language programming, educators teaching computer architecture concepts, and anyone interested in practical applications of the MARIE processor for input processing tasks.

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?
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
5K
Replies
3
Views
2K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
5
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 15 ·
Replies
15
Views
6K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
11
Views
6K