I recently started using MIPS and am trying to do something simple. Currently, this program prints out Hello World without delay, and I want for it to print out Hello World with a 1 second delay.
.global myprog
.text
.set noreorder
.ent myprog
myprog:
loop:
la $a0,Serial
la $a1,hello
jal _ZN5Print7printlnEPKc
nop
jal mydelay
nop
j loop
nop
mydelay:
li $a2, 1000
addi $a2, $a2, -1
bgez mydelay
jr $ra
.end myprog
.data
hello: .ascii "Hello, world!\0"
Basically running through this, it would print the first Hello World the first time, goes to "mydelay" when it hits that spot, in which mydelay would loop 1000 times (which should offer somewhat of a delay, not entirely sure about this part), and then it should return to the label loop, but currently all it does is print Hello World with no delay.
$a2
with each iteration, so if your exit condition worked properly, the loop should be infinite.blez
?