Hello and how are you?
I am trying to fix the nested loop called the clock to go from 0:0:0 to 12:59:59 but I am keep getting infinite loops of 0:0:0 on mars/mips
Here is what I have:
.data
str2: .asciiz ":"
space: .asciiz "\n"
.text
main:
li $t0, 0
li $t1, 0
li $t2, 0
hour:
bgt $t0, 12, exit
bgt $t2, 59, minutes
minutes:
bgt $t1, 59, hour
seconds:
bgt $t2, 59, minutes
li $v0, 1
move $a0, $t0
syscall
li $v0, 4
la $a0, str2 #The load and print of
syscall # String
li $v0, 1
move $a0, $t1
syscall
li $v0, 4
la $a0, str2, #load and print string
syscall
li $v0, 1
move $a0, $t2
syscall
addi $v0, $zero, 4
la $a0, space
syscall
b seconds
addu $t1, $t1, 1
exit:
Can someone tell me how to do this? Thanks.