Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .data
- cadenainicio: .asciiz "introuzca 5 numeros"
- num1:
- .globl main
- .text
- main:
- li $v0,5
- syscall
- move $t4,$v0
- li $v0,5
- syscall
- move $a1,$v0
- li $v0,5
- syscall
- move $a2,$v0
- li $v0,5
- syscall
- move $a3,$v0
- li $v0,5
- syscall
- move $t1,$v0
- addi $sp, $sp, -1
- sb $v0, 0($sp)
- move $a0, $t4
- jal decimal
- move $t0,$v0
- li $v0,1
- move $a0,$t0
- syscall
- li $v0,10
- syscall
- decimal:
- li $t3, 0 #contador
- lb $t2,($sp) #valor que hemos cargado en la pila
- addi $sp,$sp, 1
- #crear el numero
- sll $a1, $a1,1
- sll $a2, $a2,2
- sll $a3, $a3,3
- sll $t2, $t2,4
- #a0=0 a1=00 a2=000 a3=1000 a4=10000---->suma=11000
- or $t3,$t3, $a0
- or $t3,$t3, $a1
- or $t3,$t2, $a2
- or $t3,$t3, $a3
- or $t3,$t3, $t2
- move $v0,$t3
- jr $ra
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement