assembly - I'm trying to make an array and sort it with a sentinel value which is 0 but it's not working it's giving me an error -
i want prompt user input want take input , put array. want print out array. know can print them out without putting them in array practice.
.data array: .space 40 prompt: .asciiz "enter integer (0 quit) :" text: .asciiz "after sorting, list of integers is:" .text .globl main main: la $a1, array read_numbers: li $v0, 4 la $a0, prompt syscall li $v0, 5 syscall sw $v0, 0($a1) addiu $a1, $a1, 4 beqz $v0, sort j read_numbers sort: la $a1, $array li $v0, 4 la $a0, text syscall loop: lw $t0, 0($a1) addiu $a1, $a1, 4 beqz $t0, done li $v0, 1 move $a0, $t0 syscall j loop done:
the error i'm having is: instruction references undefined symbol @ 0x00400050 [0x00400050] 0x3c010000 lui $1, 0 [$array] ;24: la $a1, $array
Comments
Post a Comment