head	1.2;
access;
symbols;
locks; strict;
comment	@# @;


1.2
date	2004.06.09.06.58.03;	author poppy;	state Exp;
branches;
next	1.1;

1.1
date	2004.06.03.15.09.05;	author poppy;	state Exp;
branches;
next	;


desc
@@


1.2
log
@no message
@
text
@; This file is part of gasm.
;
;    
; If you encountered any problem, please contact :
;                                                 
;   lmouton@@enserg.fr                             
;   shangoue@@enserg.fr                            
;                                                 



;===============================================================================;
;                                                                               ;
;                                                                               ;
; Fichier de donnees sur la syntaxe de l'assembleur du microprocesseur miniMIPS ;
;                                                                               ;
;                                                                               ;
;===============================================================================;

; Les instructions SET s'adressant au preparateur doivent se trouver avant la première accolade.


SET MACROFILE 	psd_instr.sx 		; Fichier macro par défaut (pseudo instructions).
SET NOCASSE				; L'assembleur MIPS n'est pas sensible à la casse

SET DEFINESTR	D			; Chaine de définition de macro
SET UNDEFSTR	U			; Chaine de supression de macro

; Il est également possible d'activer l'inclusion de fichier mais dans ce cas la liste
; d'assemblage sera interdite...
; SET INCLUDESTR	I		; Chaine d'inclusion de fichier

; Définition du séparateur d'instructions (ici, NL)
; Le séparateur est utilisé lors de la détection d'une erreur par l'analyseur pour déterminer
; à partir de quel endroit poursuivre l'assemblage. Il effectue la recherche du prochain séparateur
; puis se place juste après et continue l'analyse.
SET SEP

; Définition des sous-types que l'on utilise dans la syntaxe de l'assembleur.
; Le nombre de sous-types pouvant actuellement être référencés est de 16.
SET NUMSST	3		; Déclaration de deux sous types du type ALPHA

; Le troisième champ correspond au code du sous-type. Si plusieurs sont identiques,
; ils seront confondus par l'assembleur. On peut utiliser cette propriété pour
; définir plusieurs motifs définissant le même type.
; Codage des registres R0 à R31 (la notation R02 est autorisée) :
SET NEWSST	Reg	$?09	1
SET NEWSST	Reg	$?02?09	1
SET NEWSST	Reg	$3?01	1

; Mots clefs autorisées dans la déclaration de la syntaxe d'une instruction : Int, Alpha, Reg
; Mots clefs autorisés dans les propriétés de l'instruction : TMO, MSK, FUN
; Les masques doivent commencer par - et peuvent contenir - le caractère '_'

; Autorise les lignes vides
{
}

; Déclaration d'étiquette
{ Alpha: }
	FUN	Ajoute_Etiquette		; Ajoute une étiquette dans la table

; DÉFINITION DES DIRECTIVES

; Directives de définition des équivalences
{ Alpha EQU Alpha }
	FUN	AddEqu

{ Alpha EQU Int }
	FUN	AddEqu

; Directive d'alignement sur adresse congrue à 4
{ ALIGN4 }
	FUN	Complete_zeros

; Directives d'inclusion de données dans le code
{ DCB Int }
	TMO	1
	MSK	_0000_0000_
	FUN	Dcb_Int
{ DCB Alpha }
	TMO	1
	MSK	_0000_0000_
	FUN	Dcb_Alpha
{ DCW Int }
	TMO	4
	MSK	_0000_0000_0000_0000__0000_0000_0000_0000_
	FUN	Dcw_Int
{ DCW Alpha }
	TMO	2
	MSK	_0000_0000_0000_0000__0000_0000_0000_0000_
	FUN	Dcw_Alpha

; Directives de positionnement de l'adresse d'implantation
{ ORG Int }
	FUN	Org_Int

{ ORG Alpha }
	FUN	Org_Label

; DEFINITION DES INSTRUCTIONS

; Instruction ADD
{ ADD Reg, Reg, Reg }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_100000
	FUN	R1D
	FUN	R3S
	FUN	R5T

; Instruction ADDI
{ ADDI Reg, Reg, Int }
    TMO     4
    MSK	_001000_00000_00000__00000000_00000000
    FUN     R1T
    FUN     R3S
    FUN     IMM5
{ ADDI Reg, Reg, Alpha }
    TMO     4
    MSK	_001000_00000_00000__00000000_00000000
    FUN     R1T
    FUN     R3S
    FUN     ETIQ5

; Instruction ADDIU
{ ADDIU Reg, Reg, Int }
    TMO     4
    MSK	_001001_00000_00000__00000000_00000000
    FUN     R1T
    FUN     R3S
    FUN     IMM5

; Instruction ADDU
{ ADDU Reg, Reg, Reg }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_100001
	FUN	R1D
	FUN	R3S
	FUN	R5T

; Instruction AND
{ AND Reg, Reg, Reg }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_100100
	FUN	R1D
	FUN	R3S
	FUN	R5T

; Instruction ANDI
{ ANDI Reg, Reg, Int }
	TMO	4
	MSK	_001100_00000_00000__00000000_00000000
	FUN	R1T
	FUN	R3S
	FUN	IMM5
{ ANDI Reg, Reg, Alpha }
	TMO	4
	MSK	_001100_00000_00000__00000000_00000000
	FUN	R1T
	FUN	R3S
	FUN	ETIQ5

; Instruction BEQ
{ BEQ Reg, Reg, Alpha }
	TMO	4
	MSK	_000100_00000_00000__0000_0000_0000_0000
	FUN	R1S
	FUN	R3T
	FUN	OFFSET5

; Instruction BGEZ
{ BGEZ Reg, Alpha }
	TMO	4
	MSK	_000001_00000_00001__00000000_00000000
	FUN	R1S
	FUN	OFFSET3

; Instruction BGEZAL
{ BGEZAL Reg, Alpha }
	TMO	4
	MSK	_000001_00000_10001__00000000_00000000
	FUN	R1S
	FUN	OFFSET3

; Instruction BGTZ
{ BGTZ Reg, Alpha }
	TMO	4
	MSK	_000111_00000_00000__00000000_00000000
	FUN	R1S
	FUN	OFFSET3

; Instruction BLEZ
{ BLEZ Reg, Alpha }
	TMO	4
	MSK	_000110_00000_00000__00000000_00000000
	FUN	R1S
	FUN	OFFSET3

; Instruction BLTZ
{ BLTZ Reg, Alpha }
	TMO	4
	MSK	_000001_00000_00000__00000000_00000000
	FUN	R1S
	FUN	OFFSET3

; Instruction BLTZAL
{ BLTZAL Reg, Alpha }
	TMO	4
	MSK	_000001_00000_10000__00000000_00000000
	FUN	R1S
	FUN	OFFSET3

; Instruction BNE
{ BNE Reg, Reg, Alpha }
	TMO	4
	MSK	_000101_00000_00000__00000000_00000000
	FUN	R1S
	FUN	R3T
	FUN	OFFSET5

; Instruction BREAK
{ BREAK }
	TMO	4
	MSK	_000000__00000_00000_00000_00000__001101

; Instruction COP0
{ COP0 Int }
	TMO	4
	MSK	_010000_00001_00000_0000_0000_0000_0000
    FUN IMM1

; Instruction J
{ J Alpha }
	TMO	4
	MSK	_000010__00_0000_0000_0000_0000_0000_0000
	FUN	ABSOLU1

; Instruction JAL
{ JAL Alpha }
	TMO	4
	MSK	_000011__00_0000_0000_0000_0000_0000_0000
	FUN	ABSOLU1

; Instruction JALR
{ JAL Reg, Reg }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_001001
	FUN	R1D
	FUN	R3S

; Instruction JALR avec rd=$31 implicite
{ JAL Reg }
	TMO	4
	MSK	_000000_00000_00000_11111_00000_001001
	FUN	R1S

; Instruction JR
{ JR Reg }
	TMO	4
	MSK	_000000_00000__000_0000_0000_0000__001000
	FUN	R1S

; Instruction LUI
{ LUI Reg, Int }
    TMO 4
    MSK _001111_00000_00000__0000_0000_0000_0000
    FUN R1T
    FUN IMM3
{ LUI Reg, Alpha }
    TMO 4
    MSK _001111_00000_00000__0000_0000_0000_0000
    FUN R1T
    FUN ETIQ3

; Instruction LW
{ LW Reg, Int(Reg) }
	TMO	4
	MSK	_100011_00000_00000__0000_0000_0000_0000
	FUN	R1T
	FUN	IMM3
	FUN	R5S

; Instruction LWC0
{ LWC0 Reg, Int(Reg) }
    TMO 4
    MSK _110000_00000_00000__0000_0000_0000_0000
    FUN R1T
    FUN IMM3
    FUN R5S

; Instruction MFC0
{ MFC0 Reg, Reg }
    TMO 4
    MSK _010000_00000_00000_00000__000000_00000
    FUN R1D
    FUN R3T

; Instruction MFHI
{ MFHI Reg }
	TMO	4
	MSK	_000000_0000000000_00000_00000_010000
	FUN	R1D

; Instruction MFLO
{ MFLO Reg }
	TMO	4
	MSK	_000000_0000000000_00000_00000_010010
	FUN	R1D

; Instruction MTC0
{ MTC0 Reg, Reg }
    TMO 4
    MSK _010000_00100_00000_00000__000000_00000
    FUN R1T
    FUN R3D

; Instruction MTHI
{ MTHI Reg }
	TMO	4
	MSK	_000000_00000__0_0000_0000_0000_00__010001
	FUN	R1S

; Instruction MTLO
{ MTLO Reg }
	TMO	4
	MSK	_000000_00000__0_0000_0000_0000_00__010011
	FUN	R1S

; Instruction MULT
{ MULT Reg, Reg }
    TMO 4
    MSK _000000_00000_00000__0000_0000_00__011000
    FUN R1S
    FUN R3T

; Instruction MULTU
{ MULTU Reg, Reg }
    TMO 4
    MSK _000000_00000_00000__0000_0000_00__011001
    FUN R1S
    FUN R3T

; Instruction NOR
{ NOR Reg, Reg, Reg }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_100111
	FUN	R1D
	FUN	R3S
	FUN	R5T

; Instruction OR
{ OR Reg, Reg, Reg }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_100101
	FUN	R1D
	FUN	R3S
	FUN	R5T

; Instruction ORI
{ ORI Reg, Reg, Int }
    TMO     4
	MSK     _001101_00000_00000__00000000_00000000
    FUN     R1T
    FUN     R3S
    FUN     IMM5
{ ORI Reg, Reg, Alpha }
    TMO     4
	MSK	    _001101_00000_00000__00000000_00000000
    FUN     R1T
    FUN     R3S
    FUN     ETIQ5

; Instruction SLL
{ SLL Reg, Reg, Int }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_000000
	FUN	R1D
	FUN	R3T
	FUN	SA5

; Instruction SLLV
{ SLLV Reg, Reg, Reg }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_000100
	FUN	R1D
	FUN	R3T
	FUN	R5S

; Instruction SLT
{ SLT Reg, Reg, Reg }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_101010
	FUN	R1D
	FUN	R3S
	FUN	R5T

; Instruction SLTI
{ SLTI Reg, Reg, Int }
    TMO     4
	MSK 	_001010_00000_00000__00000000_00000000
    FUN     R1T
    FUN     R3S
    FUN     IMM5
{ SLTI Reg, Reg, Alpha }
    TMO     4
	MSK 	_001010_00000_00000__00000000_00000000
    FUN     R1T
    FUN     R3S
    FUN     ETIQ5

; Instruction SLTIU
{ SLTIU Reg, Reg, Int }
    TMO     4
    MSK	    _001010_00000_00000__00000000_00000000
    FUN     R1T
    FUN     R3S
    FUN     IMM5
{ SLTIU Reg, Reg, Alpha }
    TMO     4
    MSK	    _001010_00000_00000__00000000_00000000
    FUN     R1T
    FUN     R3S
    FUN     ETIQ5

; Instruction SLTU
{ SLTU Reg, Reg, Reg }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_101011
	FUN	R1D
	FUN	R3S
	FUN	R5T

; Instruction SRA
{ SRA Reg, Reg, Int }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_000011
	FUN	R1D
	FUN	R3T
	FUN	SA5

; Instruction SRAV
{ SRAV Reg, Reg, Reg }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_000111
	FUN	R1D
	FUN	R3T
	FUN	R5S

; Instruction SRL
{ SRL Reg, Reg, Int }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_000010
	FUN	R1D
	FUN	R3T
	FUN	SA5

; Instruction SRLV
{ SRLV Reg, Reg, Reg }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_000110
	FUN	R1D
	FUN	R3T
	FUN	R5S

; Instruction SUB
{ SUB Reg, Reg, Reg }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_100010
	FUN	R1D
	FUN	R3S
	FUN	R5T

; Instruction SUBU
{ SUBU Reg, Reg, Reg }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_100011
	FUN	R1D
	FUN	R3S
	FUN	R5T

; Instruction SW
{ SW Reg, Int(Reg) }
	TMO	4
	MSK	_101011_00000_00000__0000_0000_0000_0000
	FUN	R1T
	FUN	IMM3
	FUN	R5S

; Instruction SWC0
{ SWC0 Reg, Int(Reg) }
	TMO	4
	MSK	_111000_00000_00000__0000_0000_0000_0000
	FUN	R1T
	FUN	IMM3
	FUN	R5S

; Instruction SYSCALL
{ SYSCALL }
	TMO	4
	MSK	_000000__00000_00000_00000_00000__001100

; Instruction XOR
{ XOR Reg, Reg, Reg }
	TMO	4
	MSK	_000000_00000_00000_00000_00000_100110
	FUN	R1D
	FUN	R3S
	FUN	R5T

; Instruction XORI
{ XORI Reg, Reg, Int }
    TMO     4
	MSK 	_001110_00000_00000__00000000_00000000
    FUN     R1T
    FUN     R3S
    FUN     IMM5
{ XORI Reg, Reg, Alpha }
    TMO     4
	MSK     _001110_00000_00000__00000000_00000000
    FUN     R1T
    FUN     R3S
    FUN     ETIQ5
@


1.1
log
@version 1.0
@
text
@@

