cours_progra/bac1/q2/fonctio/tp2/spim-to-hex.s
Debucquoy 4fd7542f03
.
2023-09-20 15:18:20 +02:00

28 lines
293 B
ArmAsm

.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
la $t9, hex
addu $t9, $t9, $t2
lb $a0 0($t9)
li $v0, 11
syscall
mflo $v0
bne $v0, 0, divi
jr $ra