aboutsummaryrefslogtreecommitdiff
path: root/semestre 3/architecture des ordinateurs/tme/tme5/exo3.asm
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-11-01 13:27:41 +0100
committerAnhgelus Morhtuuzh <william@herges.fr>2025-11-01 13:27:41 +0100
commit341fc63ff791e08c7d0a00346080067c9bd1d5dd (patch)
tree817638957893aa4899da4386483a29baa6e99151 /semestre 3/architecture des ordinateurs/tme/tme5/exo3.asm
parentb47e5b1518d7089a2f6fdba439cf35dcf29e6089 (diff)
Cours du 17 au 21 octobre
Diffstat (limited to 'semestre 3/architecture des ordinateurs/tme/tme5/exo3.asm')
-rw-r--r--semestre 3/architecture des ordinateurs/tme/tme5/exo3.asm17
1 files changed, 17 insertions, 0 deletions
diff --git a/semestre 3/architecture des ordinateurs/tme/tme5/exo3.asm b/semestre 3/architecture des ordinateurs/tme/tme5/exo3.asm
new file mode 100644
index 0000000..715303b
--- /dev/null
+++ b/semestre 3/architecture des ordinateurs/tme/tme5/exo3.asm
@@ -0,0 +1,17 @@
+.data
+ch: .asciiz "Bonjour, je suis une licorne avec des pouvoirs magiques :D" # len(ch) 58
+.text
+ lui $8, 0x1001
+ ori $9, $0, 0 # n
+while:
+ lb $10, 0($8)
+ beq $10, $0, end_while
+ addiu $9, $9, 1
+ addiu $8, $8, 1
+ j while
+end_while:
+ ori $2, $0, 1
+ or $4, $0, $9
+ syscall
+ ori $2, $0, 10
+ syscall \ No newline at end of file