.
This commit is contained in:
33
bac1/q2/fonctio/tp2/spim-read-int.s
Normal file
33
bac1/q2/fonctio/tp2/spim-read-int.s
Normal file
@ -0,0 +1,33 @@
|
||||
.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
|
Reference in New Issue
Block a user