rss
twitter
facebook

Home

Menor de 3 numeros

.data
val1: .word 0x10
val2: .word 0x35
val3: .word 0x16
max: .word 0
# aux1 reside no registo $t1 do CPU
.text
.globl main
main:
la $t0, val1 # $t0 = val1
lw $t1, 0($t0) # aux1 = val1
lw $t2, 4($t0) # aux2 = val2
lw $t3, 8($t0) # aux3 = val3
bge $t2,$t1,endif # if( aux2 > aux1) {
move $t1,$t2 # aux1 = aux2
# }
endif: bge $t3,$t1, endfor
move $t1, $t3

endfor: sw $t1, 12($t0)


jr $ra

0 comentários:

 
Powered by Blogger