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/exo5.asm | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 semestre 3/architecture des ordinateurs/tme/tme5/exo5.asm (limited to 'semestre 3/architecture des ordinateurs/tme/tme5/exo5.asm') diff --git a/semestre 3/architecture des ordinateurs/tme/tme5/exo5.asm b/semestre 3/architecture des ordinateurs/tme/tme5/exo5.asm new file mode 100644 index 0000000..1ca188b --- /dev/null +++ b/semestre 3/architecture des ordinateurs/tme/tme5/exo5.asm @@ -0,0 +1,24 @@ +.data +n: .word 123 +.text + lui $8, 0x1001 + lw $9, 0($8) + + ori $11, $0, 1 + ori $10, $0, 31 + ori $13, $0, 0 +while: + bltz $10, end_while + srlv $12, $9, $10 + andi $12, $12, 1 + beq $12, $0, end_if + addiu $13, $13, 1 +end_if: + subu $10, $10, $11 + j while +end_while: + ori $2, $0, 1 + or $4, $0, $13 + syscall + ori $2, $0, 10 + syscall \ No newline at end of file -- cgit v1.2.3