diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2025-10-10 23:15:18 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2025-10-10 23:15:18 +0200 |
| commit | 4ed8060318b1807638c12b8b43660bb98fc99fba (patch) | |
| tree | 976f9b6be6cfbb72c3c908e2e1e60069f5a4296a /semestre 3/architecture des ordinateurs/tme/tme4/exo2.asm | |
| parent | 85fbaa4d9381e435be129aa7bc4ea6a472acb2b2 (diff) | |
Cours du 6 au 10 octobre
Diffstat (limited to 'semestre 3/architecture des ordinateurs/tme/tme4/exo2.asm')
| -rw-r--r-- | semestre 3/architecture des ordinateurs/tme/tme4/exo2.asm | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/semestre 3/architecture des ordinateurs/tme/tme4/exo2.asm b/semestre 3/architecture des ordinateurs/tme/tme4/exo2.asm new file mode 100644 index 0000000..9c66651 --- /dev/null +++ b/semestre 3/architecture des ordinateurs/tme/tme4/exo2.asm @@ -0,0 +1,32 @@ +.data +v1: .word -1 +v2: .word 0xFF + +o: .byte 0xFF +.text + lui $8, 0x1001 + lw $9, 0($8) + or $4, $0, $9 + ori $2,$0,1 + syscall + + lw $10, 4($8) + or $4, $10, $10 + syscall + + addi $9, $9, 1 + sw $9, 0($8) + addi $10, $10, 1 + sw $10, 4($8) + + addi $8, $8, 8 # on récupère l'adresse de o + lb $9, 0($8) + or $4, $0, $9 + syscall # affiche -1 car il l'étend + lbu $10, 0($8) + or $4, $0, $10 + syscall # affiche 255 car il n'est pas signé + + ori $2, $0, 10 + syscall +
\ No newline at end of file |
