diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-01-20 13:55:21 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-01-20 13:55:21 +0100 |
| commit | 42e9569176360b5e1881d317c74ce8522a2af6d1 (patch) | |
| tree | 9df17cba32ac37cf34f486f3fbf335a19f8a14ca /semestre 3/architecture des ordinateurs/2- Programmation en ASM Mips.md | |
| parent | ecf05510045b2ac78b479ae746a43078e22cee4f (diff) | |
Derniers cours du S3
Diffstat (limited to 'semestre 3/architecture des ordinateurs/2- Programmation en ASM Mips.md')
| -rw-r--r-- | semestre 3/architecture des ordinateurs/2- Programmation en ASM Mips.md | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/semestre 3/architecture des ordinateurs/2- Programmation en ASM Mips.md b/semestre 3/architecture des ordinateurs/2- Programmation en ASM Mips.md index edc5cd3..568a612 100644 --- a/semestre 3/architecture des ordinateurs/2- Programmation en ASM Mips.md +++ b/semestre 3/architecture des ordinateurs/2- Programmation en ASM Mips.md @@ -395,22 +395,22 @@ int main(){ ```asm .text # prologue -addiu $29, $29, -12 # car on stock 3 mots + addiu $29, $29, -12 # car on stock 3 mots # initialisation des variables -ori $8, $0, 1 -sw $8, 0($29) -ori $8, $0, 2 -sw $8, 4($29) + ori $8, $0, 1 + sw $8, 0($29) + ori $8, $0, 2 + sw $8, 4($29) # corps du main -lw $8, 0($29) -lw $9, 4($29) -addu $8, $8, $9 -sw $9, 8($29) + lw $8, 0($29) + lw $9, 4($29) + addu $8, $8, $9 + sw $9, 8($29) # épilogue -addiu $29, $29, 12 + addiu $29, $29, 12 # exit -ori $2, $0, 10 -syscall + ori $2, $0, 10 + syscall ``` ## Fonction Pour arriver à une fonction, on utilise `jal label` |
