From 341fc63ff791e08c7d0a00346080067c9bd1d5dd Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Sat, 1 Nov 2025 13:27:41 +0100 Subject: Cours du 17 au 21 octobre --- .../architecture des ordinateurs/tme/tme5/exo1.asm | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 semestre 3/architecture des ordinateurs/tme/tme5/exo1.asm (limited to 'semestre 3/architecture des ordinateurs/tme/tme5/exo1.asm') diff --git a/semestre 3/architecture des ordinateurs/tme/tme5/exo1.asm b/semestre 3/architecture des ordinateurs/tme/tme5/exo1.asm new file mode 100644 index 0000000..4337468 --- /dev/null +++ b/semestre 3/architecture des ordinateurs/tme/tme5/exo1.asm @@ -0,0 +1,33 @@ +.data +p: .word 0 # 0x1001 0000 +q: .word 0 # 0x1001 0004 +.text + lui $8, 0x1001 # $8 <- 0x1001 0000 + ori $2, $0, 5 + syscall + lui $8, 0x1001 # $8 <- 0x1001 0000 + sw $2, 0($8) + ori $2, $0, 5 + syscall + lui $8, 0x1001 # $8 <- 0x1001 0000 + sw $2, 4($8) + + lw $12, 0($8) # p + lw $13, 4($8) # q + or $10, $0, $12 # i + ori $11, $0, 0 # somme +for: + # i+1 > q + addiu $14, $10, 1 + slt $15, $13, $14 + bne $15, $0, end_for + addu $11, $11, $10 # somme += i + addiu $10, $10, 1 + j for +end_for: + ori $2, $0, 1 + or $4, $0, $11 + syscall + + ori $2, $0, 10 + syscall \ No newline at end of file -- cgit v1.2.3