cours_progra/bac1/q2/fonctio/tp2/spim-to-hex.s

28 lines
293 B
ArmAsm
Raw Normal View History

2023-05-05 16:04:44 +02:00
.data
hex: .asciiz "0123456789ABCDEF"
q1: .asciiz "Entrez un nombre"
.text
main:
li $v0, 4
la $a0, q1
syscall
li $v0, 5
syscall
li $t0 16 #base
divi:
div $v0, $t0
mfhi $t2
2023-05-08 09:32:02 +02:00
la $t9, hex
2023-05-05 16:04:44 +02:00
addu $t9, $t9, $t2
lb $a0 0($t9)
li $v0, 11
syscall
mflo $v0
bne $v0, 0, divi
jr $ra