28 lines
222 B
ArmAsm
28 lines
222 B
ArmAsm
|
.data
|
||
|
ask: .ascii "Entrez un nombre:"
|
||
|
|
||
|
.text
|
||
|
main:
|
||
|
|
||
|
# Print(ask)
|
||
|
li $v0 4
|
||
|
la $a0 ask
|
||
|
syscall
|
||
|
|
||
|
# read()
|
||
|
li $v0 5
|
||
|
syscall
|
||
|
|
||
|
li $t0 2 #base
|
||
|
|
||
|
divi:
|
||
|
|
||
|
div $v0, $t0
|
||
|
li $v0, 1
|
||
|
mfhi $a0
|
||
|
syscall
|
||
|
mflo $v0
|
||
|
bne $v0, 0, divi
|
||
|
|
||
|
jr $ra
|