Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
13
Task/Loops-Do-while/MIPS-Assembly/loops-do-while.mips
Normal file
13
Task/Loops-Do-while/MIPS-Assembly/loops-do-while.mips
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
.text
|
||||
main: li $s0, 0 # start at 0.
|
||||
li $s1, 6
|
||||
loop: addi $s0, $s0, 1 # add 1 to $s0
|
||||
div $s0, $s1 # divide $s0 by $s1. Result is in the multiplication/division registers
|
||||
mfhi $s3 # copy the remainder from the higher multiplication register to $s3
|
||||
move $a0, $s0 # variable must be in $a0 to print
|
||||
li $v0, 1 # 1 must be in $v0 to tell the assembler to print an integer
|
||||
syscall # print the integer in $a0
|
||||
bnez $s3, loop # if $s3 is not 0, jump to loop
|
||||
|
||||
li $v0, 10
|
||||
syscall # syscall to end the program
|
||||
Loading…
Add table
Add a link
Reference in a new issue