Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- main:
- addi $sp, $sp, -400 #alloco posti in sp
- addi $t0, $zero, 99 #indice per il for
- for: beq $t0, -1, print
- sll $t1, $t0, 2 #indice stack in Byte
- add $t1, $sp, $t1 #indice stack reale
- sw $t0, 0($t1) #salvo dato
- addi $t0, $t0, -1 #avanzo indice for
- j for
- print:
- addi $t0, $zero, 0 #indice for
- for2: beq $t0, 100, out
- sll $t1, $t0, 2 #indice stack in Byte
- add $t1, $sp, $t1 #indice stack reale
- lw $a0, 0($t1) #carico word da stampare
- addi $v0, $zero, 1 #comando syscall
- syscall
- add $t0, $t0, 1 #avanzo indice for
- j for2
- out: addi $sp, $sp, 400 #dealloco dallo stack
- j exit
- exit:
- addi $v0, $zero, 10 #routine di uscita
- syscall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement