asked 55.5k views
3 votes
Write a simplified machine language program that has register $s0 loop through the numbers 0, 100, 200, ..., 500. See Lab 11 for details on submitting the simplified machine language programs.

1 Answer

3 votes

Answer:

Step-by-step explanation:

li $s4 , 100 // Initialize register $s4 with 500 for checking the condition when $s0 is equal to 500

Loop : li $s0 , 0 // Initialize register $s0 with0

abc : addi $s0 , 100 // Add 100 to register $s0

bne $s0, $s4 , abc // Branch to label abc if not equal to 500

beq $s0, $s4 , Loop // Branch to label Loop if equal to 500

answered
User Sunsay
by
9.0k points