Architecture MIPS
Architecture MIPS
Ces notes de cours on été prises dans le cadre du cours (INF 4170 Architecture des ordinateurs) avec Bruno Malenfant .
Le But : Quelque chose qui est simple est facile a integrer en Architecture .
Le Type du jeu de l’architecture MIPS est RISC .
RISC : Reduced Instruction Set Computer . (instructions simple)
L’autre Type qui existe : (CISC)
CISC : Complexe Instruction Set Computer . (instruction complexe ~ +150)
Les Types D’instructions :
Arithmétique (Logique) : ADD , SUB , AND , OR , XOR .
Rangement/Chargement : Opération qui communique avec la mémoire (LOAD , STORE , LW , SW …)
Architecture mémoire a mémoire : permettre aux autres instructions d’accéder a la mémoire .
Contrôle : affercer (PC , CO )
# < = pour les Commentaires .
Quand on parle de RISC :
- 1 Accès mémoire maximum
- 2 lectures / 1 écriture registre
- 1 accès UAL
- 32 bits / instruction
Registres :
$0 , $1 , $2 ………………… $31 (tous des registres de 32 bits)
Caractéristique Importante : le registre $0 = 0 (toujours 0 ~ zero)
Les Instructions de l’architecture MIPS
L’instruction ADD
L’instruction ADD a un encodage de type “R” .
ADD $a , $b , $c # $a < = $b + $c
Exemple : ADD $1 , $ 2, $3 ==> Ajouter le registre $2 au registre $3 et mettre le résultat dans le registre $1 .
L’instruction SUB
L’instruction SUB a un encodage de type “R” .
SUB $a , $b , $c # $a < = $b - $c
L’instruction Rangement/Chargement
LW (load Word) # Cherche Un mot en mémoire => accès mémoire .
LW $a , IMM ($b) #mode relatif
SW $a , IMM($b) # MEM [$b + IMM] < = $a , ca fait l'inverse de LW
ADDI : Additionner une valeur immédiate mais elle va être encoder comme instruction de type chargement/dechargement .
ADDi $a , $b ,IMM # $a < = $b + IMM
LUI : LOAD UPPER IMMEDIATE
LUI $a , IMM # $a < = IMM * 2^16
Branchement
BEQ $a , $b , IMM # Si $a == $b alors PC <= PC + (IMM * 4)
BNE $a , $b , IMM # Si $a != $b alors PC <= PC + IMM * 4
SLT : Set Least Then
SLT $a , $b , $c # Si $b <$c alors $a <= 1 sinon $a <= 0
Instruction de Contrôle non conditionnel
J : Jump to …
J etiq # prend étiquette et saute a cette étiquette
JAL : Jump and Link
JAL Etiq # le registre $31 va prendre l’adresse de pc
On essaye de garder les valeurs dans les registres … si on a besoins de tous les registres on utilise la pile .
JALR : jump and link to registry
JALR $a , $b # $a <= pc , pc <=$b
thx a lot man but would u pleaze explane more then this ??
Hello,
can you please help me with some exampels with solutions of programs made in the assembler language, i realy need it, we just started it in the class, and i have some problems to understand it. We are working on the MIPS, the same than in the articl that Tarik Chaaban put here. I need problems with solutions to familiarize with the language and then go ahead alone.
Thank you for any help.
You should be a part of a contest for one of the most
useful blogs online. I am going to highly recommend this
site!