.
This commit is contained in:
32
bac1/q2/fonctio/tp2/spim-add-int.s
Normal file
32
bac1/q2/fonctio/tp2/spim-add-int.s
Normal file
@ -0,0 +1,32 @@
|
||||
.data
|
||||
txt1: .asciiz "Entrez un premier nombre:"
|
||||
txt2: .asciiz "Entrez un second nombre:"
|
||||
|
||||
.text
|
||||
main:
|
||||
# print txt1
|
||||
la $a0, txt1
|
||||
li $v0, 4
|
||||
syscall
|
||||
|
||||
#read t0
|
||||
li $v0, 5
|
||||
syscall
|
||||
move $t0, $v0
|
||||
|
||||
# print txt2
|
||||
li $v0, 4
|
||||
la $a0, txt2
|
||||
syscall
|
||||
|
||||
#read t1
|
||||
li $v0, 5
|
||||
syscall
|
||||
move $t1, $v0
|
||||
|
||||
# a0 = t0 + t1
|
||||
add $a0, $t1, $t0
|
||||
|
||||
li $v0, 1
|
||||
syscall
|
||||
jr $ra
|
Reference in New Issue
Block a user