So i have to make this code work for my class. Basically i have to find if the number the user typed is in the array pre-filled. And this is all i could do so far... i would like some help with the rest of it.
.data
array: .word 1, 2, 4, 8, 16, 32, 64, 128, 50, 10
number: .asciiz "Number to find: "
true: .asciiz "Number is in array"
false: .asciiz "Number is not in array"
quebrarLinha: .asciiz "\n"
.text
la $t0, array
li $v0, 4
la $a0, numero
li $t0, 0
addi $t0, $zero, 0
loop:
beq $t0, 40, exit
lw $t6, num($t0)
addi $t0, $t0, 4
li $v0, 1
move $a0, $t6
syscall
li $v0, 4
la $a0, quebrarLinha
syscall
j loop
exit:
li, $v0, 4
la $a0, numero
syscall
li, $v0, 5
syscall
move $t1, $v0