From 4ed8060318b1807638c12b8b43660bb98fc99fba Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Fri, 10 Oct 2025 23:15:18 +0200 Subject: Cours du 6 au 10 octobre --- .../architecture des ordinateurs/tme/tme4/exo5.asm | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 semestre 3/architecture des ordinateurs/tme/tme4/exo5.asm (limited to 'semestre 3/architecture des ordinateurs/tme/tme4/exo5.asm') diff --git a/semestre 3/architecture des ordinateurs/tme/tme4/exo5.asm b/semestre 3/architecture des ordinateurs/tme/tme4/exo5.asm new file mode 100644 index 0000000..c63dc69 --- /dev/null +++ b/semestre 3/architecture des ordinateurs/tme/tme4/exo5.asm @@ -0,0 +1,30 @@ +.data +tab: .word 4, 23, 12, 3, 8, 1 + .align 2 +s: .space 4 + .align 2 +p: .space 4 +.text + lui $8, 0x1001 # @tab + addiu $9, $8, 24 # @s + addiu $10, $9, 4 # @p + # s = tab[3] + lw $11, 12($8) + sw $11, 0($9) + # p = tab[4] + lw $12, 16($8) + sw $12, 0($10) + + # tab[0] = s + 1 + addi $13, $11, 1 + sw $13, 0($8) + # tab[1] = s + p + add $13, $11, $12 + sw $13, 4($8) + # tab[2] = tab[5] + lw $13, 20($8) + sw $13, 8($8) + + # exit() + ori $2, $0, 10 + syscall \ No newline at end of file -- cgit v1.2.3