Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays 在mips中求最小整数及其地址_Arrays_Assembly_Mips_Min_Minimum - Fatal编程技术网

Arrays 在mips中求最小整数及其地址

Arrays 在mips中求最小整数及其地址,arrays,assembly,mips,min,minimum,Arrays,Assembly,Mips,Min,Minimum,我正在学习汇编语言,我正在使用mips。 我的代码工作正常,但在数组完成时不会停止 这是我的密码 你能告诉我什么是正确的条件(在B:)停止程序并存在吗 .data A: .word 12,31,5,72,4 E: .byte .text la $t1,A # t1 is the min lw $s1,A la $t2,E subu $t5,$t2,$t1 # t5 to know the location of the last value and decreses i

我正在学习汇编语言,我正在使用mips。 我的代码工作正常,但在数组完成时不会停止

这是我的密码 你能告诉我什么是正确的条件(在B:)停止程序并存在吗

.data
A: .word 12,31,5,72,4
E: .byte

.text 

la $t1,A        # t1 is the min
lw $s1,A
la $t2,E
subu $t5,$t2,$t1    # t5 to know the location of the last value and decreses it 

move $t6,$t1
move $t3,$t1        #adress of next value

srl $t4,$t5,2
addi $t7,$t4,0

outerloop:
#addiu $t1,$t1,4

x:
addiu $t3,$t3,4
lw $s2,0($t3)

bleu $s1,$s2,B
move $t6,$t3
lw $s6,0($t6)

subiu $t5,$t5,4
B: j x 

exit:
li $v0,10
syscall

您将需要定义数组的大小并测试选中元素的数量,或者定义数组的最后一个元素(例如零),如果遇到该元素,则停止