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

34 lines
356 B
ArmAsm

.data
question: .asciiz "Entrez un nombre: "
gr: .asciiz "Trop Grand!\n"
pe: .asciiz "Valeur acceptee\n"
.text
main:
la $a0, question
li $v0, 4
syscall
li $v0, 5
syscall
bgt $v0, 10, grand
bgt $v0, 0, petit
jr $ra
grand:
la $a0, gr
li $v0, 4
syscall
j main
petit:
la $a0, pe
li $v0, 4
syscall
lr $a0,
li $v0, 4
syscall
j main