PROC_TYPE EQU $59E
_COOKIE EQU $5A0
TAILLE_PILE EQU 1800

 ILABEL TOS.Q

DEBUT:

 MOVE.L 4(SP),A5;d‚but de la basepage
 MOVE.L $C(A5),D0;taille segment TEXT
 ADD.L $14(A5),D0;taille segment DATA
 ADD.L $1C(A5),D0;taille segment BSS
 ADD.L #TAILLE_PILE,D0;pour la pile et la basepage
 AND.B #$FE,D0
 LEA -104(A5,D0.L),SP
 SETBLOCK D0,(A5)
 MOVE.L #"_MCH",D0
 BSR GET_COOKIE
 BMI \1;pas de cookie-jar
 MOVE.L D0,A0
 CMP.L #$30000,(A0);FALCON
 BNE \1
 MOVE.L #"_CPU",D0
 BSR GET_COOKIE
 BMI \1;pas de cookie-jar
 MOVE.L D0,A0
 MOVE 2(A0),TYPE_CPU
; CMP.L #60,(A0)
; BNE \1
 SUPEXEC INIT_EXC
 PRINTLINE MESS1
 KEEPPROC #0,#FIN-DEBUT+TAILLE_PILE;programme r‚sidant
\1:TERM
 ILLEGAL
 RTS
 
INIT_EXC:

 MOVEM.L D0/A0/A1,-(SP)
 LEA 8,A0;Bus Error
 LEA ERREUR_BUS(PC),A1
 MOVE.L A1,(A0)+
 LEA ERREUR_ADRESSE(PC),A1
 MOVE.L A1,(A0)+
 LEA INSTRUCTION_ILLEGALE(PC),A1
 MOVE.L A1,(A0)+
; LEA ZERO_DIVIDE(PC),A1
; MOVE.L A1,(A0)+
; LEA SAUT_INTER(PC),A1
; MOVE.L A1,(A0)+
; MOVE.L A1,(A0)+
; LEA VIOLATION_PRIVILEGE(PC),A1
; MOVE.L A1,(A0)+
; LEA TRACE(PC),A1
; MOVE.L A1,(A0)+
; LEA LINEA(PC),A1
; MOVE.L A1,(A0)+
; ADD.L #24,A0
; LEA LINEF(PC),A1
; MOVE.L A1,(A0)+
; LEA EMULATOR_INT(PC),A1
; MOVE.L A1,(A0)+
; LEA SAUT_INTER(PC),A1
; MOVE.L A1,(A0)+
 CMP #30,TYPE_CPU
 BLS.S \1
 ADD.L #36,A0
 LEA ERREUR_FORMAT(PC),A1
 MOVE.L A1,(A0)+
; LEA UNINIT_INT(PC),A1
; MOVE.L A1,(A0)+
; LEA SAUT_INTER(PC),A1
; MOVE.L A1,(A0)+
; MOVE.L A1,(A0)+
; MOVE.L A1,(A0)+
; MOVE.L A1,(A0)+ 
; MOVE.L A1,(A0)+
; MOVE.L A1,(A0)+
; MOVE.L A1,(A0)+
; MOVE.L A1,(A0)+  
; LEA SPURIOUS_INT(PC),A1
; MOVE.L A1,(A0)+ 
; LEA INT1(PC),A1
; MOVE.L A1,(A0)+ 
; LEA INT2(PC),A1
; MOVE.L A1,(A0)+ 
; LEA INT3(PC),A1
; MOVE.L A1,(A0)+ 
; LEA INT4(PC),A1
; MOVE.L A1,(A0)+ 
; LEA INT5(PC),A1
; MOVE.L A1,(A0)+ 
; LEA INT6(PC),A1
; MOVE.L A1,(A0)+ 
; LEA INT7(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP0(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP1(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP2(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP3(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP4(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP5(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP6(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP7(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP8(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP9(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP10(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP11(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP12(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP13(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP14(PC),A1
; MOVE.L A1,(A0)+ 
; LEA TRAP15(PC),A1
; MOVE.L A1,(A0)+  
; MOVE #255-48,D0
; LEA SAUT_INTER(PC),A1
;\2:MOVE.L A1,(A0)+
; DBRA D0,\2
\1:MOVEM.L (SP)+,D0/A0/A1
 RTS

ERREUR_BUS:

 MOVE #2,VECT_EXC
 BRA PROC_EXC

ERREUR_ADRESSE:

 MOVE #3,VECT_EXC
 BRA PROC_EXC

INSTRUCTION_ILLEGALE:

 MOVE #4,VECT_EXC
 BRA PROC_EXC
 
ZERO_DIVIDE:

 MOVE #5,VECT_EXC
 BRA PROC_EXC
 
VIOLATION_PRIVILEGE:

 MOVE #8,VECT_EXC
 BRA PROC_EXC

TRACE:

 MOVE #9,VECT_EXC
 BRA PROC_EXC 

LINEA:

 MOVE #10,VECT_EXC
 BRA PROC_EXC 

LINEF:

 MOVE #11,VECT_EXC
 BRA PROC_EXC 

EMULATOR_INT:

 MOVE #12,VECT_EXC
 BRA PROC_EXC 

ERREUR_FORMAT:

 TST 8(SP)
 BEQ.S CUBASE
 MOVE #14,VECT_EXC
 BRA PROC_EXC
 
CUBASE:

 ADDQ #8,SP
 AND #$FFF,6(SP);format 0
 MOVE.L #ERREUR_BUS,8
 RTE 

UNINIT_INT:

 MOVE #15,VECT_EXC
 BRA PROC_EXC 

SPURIOUS_INT:

 MOVE #24,VECT_EXC
 BRA PROC_EXC 

INT1:

 MOVE #25,VECT_EXC
 BRA PROC_EXC

INT2:

 MOVE #26,VECT_EXC
 BRA PROC_EXC

INT3:

 MOVE #27,VECT_EXC
 BRA PROC_EXC
 
INT4:

 MOVE #28,VECT_EXC
 BRA PROC_EXC 
 
INT5:

 MOVE #29,VECT_EXC
 BRA PROC_EXC

INT6:

 MOVE #30,VECT_EXC
 BRA PROC_EXC
   
INT7:

 MOVE #31,VECT_EXC
 BRA PROC_EXC
 
TRAP0:

 MOVE #32,VECT_EXC
 BRA PROC_EXC

TRAP1:

 MOVE #33,VECT_EXC
 BRA PROC_EXC
 
TRAP2:

 MOVE #34,VECT_EXC
 BRA PROC_EXC
 
TRAP3:

 MOVE #35,VECT_EXC
 BRA PROC_EXC 
 
TRAP4:

 MOVE #36,VECT_EXC
 BRA PROC_EXC

TRAP5:

 MOVE #37,VECT_EXC
 BRA PROC_EXC
 
TRAP6:

 MOVE #38,VECT_EXC
 BRA PROC_EXC
 
TRAP7:

 MOVE #39,VECT_EXC
 BRA PROC_EXC 
  
TRAP8:

 MOVE #40,VECT_EXC
 BRA PROC_EXC

TRAP9:

 MOVE #41,VECT_EXC
 BRA PROC_EXC
 
TRAP10:

 MOVE #42,VECT_EXC
 BRA PROC_EXC
 
TRAP11:

 MOVE #43,VECT_EXC
 BRA PROC_EXC 
 
TRAP12:

 MOVE #44,VECT_EXC
 BRA PROC_EXC

TRAP13:

 MOVE #45,VECT_EXC
 BRA PROC_EXC
 
TRAP14:

 MOVE #46,VECT_EXC
 BRA PROC_EXC
 
TRAP15:

 MOVE #47,VECT_EXC
 BRA PROC_EXC

SAUT_RTE:

 RTE
 
SAUT_INTER:

 MOVE #$2700,SR
 MOVE 6(SP),VECT_EXC;format + vecteur offset
 LSR VECT_EXC
 LSR VECT_EXC
 AND #$FF,VECT_EXC

PROC_EXC:

 MOVE #$2700,SR
 MOVEM.L D0-A6,SAUVE_REG
 MOVE.L USP,A6
 MOVE.L A6,SAUVE_USP
 MOVE.L SP,SAUVE_SSP
 CMP #30,TYPE_CPU
 BLS.S \3
 DC.L $4E7A0002;MOVEC.L CACR,D0
 MOVE.L D0,SAUVE_CACR
\3:MOVE.L SP,D0
; AND.B #$FE,D0
 LEA PILE_CRASH,SP
 MOVE.L D0,A6
 CMP #30,TYPE_CPU
 BLS.S \2
 BSR INFOS_CRASH_060
 BRA.S \1
\2:BSR INFO_CRASH
\1:;BRA.S \1
 MOVE #$2500,SR
 CONIN_WE
 CMP.B #" ",D0
 BNE.S \1
 TERM
 ILLEGAL
 RTS 
 
INFOS_CRASH_060:

 PRINTLINE MESS3
 MOVE VECT_EXC,D7;no de vecteur
 MOVEQ #0,D0
 MOVE D7,D0
 LINK A5,#-4
 CLR -2(A5)
 LEA -4(A5),A0
 MOVEQ #3,D1
 BSR CONV_DECI
 PRINTLINE -4(A5)
 UNLK A5
 CONOUT #":"
 CONOUT #" "
 LEA TAB_MESS_EXC,A0
 MOVE D7,D0
 BSR PRINTLINE_TAB
 CONOUT #13
 CONOUT #10
 PRINTLINE MESS9;registre d'‚tat
 MOVE (A6),D0
 BSR AFF_HEX_WORD_D0
 PRINTLINE MESS10
 MOVE (A6)+,D2
 AND #%1011011100011111,D2
 LEA TAB_STATUS(PC),A1
 MOVEQ #15,D1
\5:BTST D1,D2
  BEQ.S \6
  MOVEQ #0,D0
  MOVE.B (A1,D1),D0
  MOVE D0,D3
  AND #$F8,D3
  CMP #$30,D3
  BNE.S \11
  MOVE D0,-(SP)
  CONOUT #"I"
  MOVE (SP)+,D0
\11:CONOUT D0
  CONOUT #" "
\6:DBRA D1,\5
 PRINTLINE MESS11;PC
 MOVE.L (A6)+,D0;PC
 BSR AFF_HEX_LONG_D0
 CONOUT #13
 CONOUT #10
 MOVE.L -4(A6),A1;PC
 MOVEQ #7,D1
\17:MOVE.L (A1)+,D0
  BSR AFF_HEX_LONG_D0
  CONOUT #" "
 DBRA D1,\17
 PRINTLINE MESS6;format
 MOVE (A6)+,D0;format + vecteur offset
 CMP #14,VECT_EXC;format error
 BNE.S \4
 MOVE 6(A6),D0
\4:MOVEQ #12,D1
 LSR D1,D0
 BSR HEX_D0
 PRINTLINE MESS8;CACR
 MOVE.L SAUVE_CACR,D0
 BSR AFF_HEX_LONG_D0
 CMP #2,D7
 BEQ.S \3;Access Fault
 CMP #3,D7
 BEQ.S \3;Address Error
 CMP #5,D7
 BEQ.S \3;Zero Divide
 CMP #9,D7
 BNE \2;<> Trace
\3:PRINTLINE MESS7;adresse acc‚d‚e
 MOVE.L (A6)+,D0
 BSR AFF_HEX_LONG_D0
 CMP #2,D7
 BNE \2;<> Access Fault
 PRINTLINE MESS4;FSLW
 MOVE.L (A6),D0;FSLW
 BSR AFF_HEX_LONG_D0
 PRINTLINE MESS10
 CONOUT #13
 CONOUT #10
 MOVE.L (A6)+,D2
 AND.L #%00001011111111111111111111111101,D2
 LEA TAB_FSLW1(PC),A1
 LEA TAB_FSLW2(PC),A2
 LEA TAB_FSLW3(PC),A3
 MOVEQ #31,D1
 MOVEQ #0,D3
\13:BTST D1,D2
  BEQ.S \14
  MOVEQ #0,D0
  MOVE.B (A1,D3),D0
  CONOUT D0
  MOVEQ #0,D0
  MOVE.B (A2,D3),D0
  CMP.B #" ",D0
  BEQ.S \12
  CONOUT D0
  MOVEQ #0,D0
  MOVE.B (A3,D3),D0
  CMP.B #" ",D0
  BEQ.S \12
  CONOUT D0
\12:CONOUT #" "
\14:ADDQ #1,D3
 DBRA D1,\13
\2:PRINTLINE MESS14;SSP
 MOVE.L SAUVE_SSP,D0
 BSR AFF_HEX_LONG_D0
 CONOUT #13
 CONOUT #10
 MOVE.L SAUVE_SSP,A1
 MOVEQ #7,D1
\15:MOVE.L (A1)+,D0
  BSR AFF_HEX_LONG_D0
  CONOUT #" "
 DBRA D1,\15
 PRINTLINE MESS15;USP
 MOVE.L SAUVE_USP,D0
 BSR AFF_HEX_LONG_D0
 CONOUT #13
 CONOUT #10
 MOVE.L SAUVE_USP,A1
 MOVEQ #7,D1
\16:MOVE.L (A1)+,D0
  BSR AFF_HEX_LONG_D0
  CONOUT #" "
 DBRA D1,\16
 LEA SAUVE_REG,A1
 LEA 32(A1),A2
 MOVEQ #7,D1
\8:CONOUT #13
  CONOUT #10
  CONOUT #"D"
  MOVEQ #7,D0
  SUB D1,D0
  OR #$30,D0
  MOVE D0,-(SP)
  BSR AFF_NO
  MOVE.L (A1),D0
  BSR AFF_HEX_LONG_D0;registres de donn‚es
  CONOUT #" "
  TST D1
  BEQ.S \9
  CONOUT #"A"
  MOVE (SP),D0
  BSR AFF_NO
  MOVE.L (A2),D0
  BSR AFF_HEX_LONG_D0;registres d'adresses
  CONOUT #" "
\9:ADDQ.L #2,SP
  ADDQ.L #4,A1
  ADDQ.L #4,A2
 DBRA D1,\8
 RTS
 
INFO_CRASH:

 PRINTLINE MESS3
 MOVE VECT_EXC,D7;no de vecteur
 MOVEQ #0,D0
 MOVE D7,D0
 LINK A5,#-4
 CLR -2(A5)
 LEA -4(A5),A0
 MOVEQ #3,D1
 BSR CONV_DECI
 PRINTLINE -4(A5)
 UNLK A5
 CONOUT #":"
 CONOUT #" "
 LEA TAB_MESS_EXC,A0
 MOVE D7,D0
 BSR PRINTLINE_TAB
 CONOUT #13
 CONOUT #10
 TST TYPE_CPU
 BNE \1;>68000
 CMP #4,D7
 BCC \1;si groupe 1-2 sur 68000
;groupe 0 Bus Error ou Adress Error sur 68000
 PRINTLINE MESS2;lect/‚crit
 MOVE (A6)+,D6
 LEA MESS2A,A5
 BTST #4,D6
 BNE.S \3
 LEA MESS2B,A5
\3:PRINTLINE (A5)
 PRINTLINE MESS5;instruction ou non
 LEA MESS5A,A5
 BTST #3,D6
 BEQ.S \4
 LEA MESS5B,A5
\4:PRINTLINE (A5)
 PRINTLINE MESS12;fonction
 LEA TAB_FONCTION,A0
 MOVE D6,D0
 AND #7,D0
 BSR PRINTLINE_TAB
 PRINTLINE MESS7;adresse acc‚d‚e
 MOVE.L (A6)+,D0
 BSR AFF_HEX_LONG_D0
 PRINTLINE MESS13;instruction code
 MOVE (A6)+,D0
 MOVE.L 2(A6),A0
 CMP.L #$400000,A0;zone programme
 BCC.S \13
 MOVEQ #4,D1
 ADDQ.L #2,A0
\7:CMP -(A0),D0;corrige PC d‚cal‚ au d‚clenchement de l'exception de 5
 DBEQ D1,\7; mots maximum
 MOVE.L A0,2(A6)
\13:BSR AFF_HEX_WORD_D0
\1:PRINTLINE MESS9;registre d'‚tat
 MOVE (A6),D0
 BSR AFF_HEX_WORD_D0
 PRINTLINE MESS10
 MOVE (A6)+,D2
 AND #%1010011100011111,D2
 LEA TAB_STATUS,A1
 MOVEQ #15,D1
\5:BTST D1,D2
  BEQ.S \6
  MOVE.B (A1,D1),D0
  MOVE D0,D3
  AND #$F8,D3
  CMP #$30,D3
  BNE.S \11
  MOVE D0,-(SP)
  CONOUT #"I"
  MOVE (SP)+,D0
\11:CONOUT D0
  CONOUT #" "
\6:DBRA D1,\5
 PRINTLINE MESS11;PC
 MOVE.L (A6)+,D0
 BSR AFF_HEX_LONG_D0
 TST TYPE_CPU
 BEQ \2;68000
 CMP #4,D7
 BCC \2;si groupe 1-2
;groupe 0 Bus Error ou Adress Error 68020-30
 ADDQ #4,A6
 PRINTLINE MESS2;lect/‚crit
 MOVE (A6)+,D6;mot sp‚cial d'‚tat
 LEA MESS2A,A5
 BTST #6,D6
 BNE.S \14
 LEA MESS2B,A5
\14:PRINTLINE (A5)
 PRINTLINE MESS5X;taille des donn‚es
 MOVEQ #0,D0
 MOVE D6,D1
 LSR #4,D1
 BCHG #0,D1
 AND #3,D1
 CMP #3,D1
 BNE.S \15
 MOVEQ #1,D1
\15:ADDQ #3,D1
 BSET D1,D0
 LINK A5,#-4
 CLR -2(A5)
 LEA -4(A5),A0
 MOVEQ #2,D1
 BSR CONV_DECI;8-16-32
 PRINTLINE -4(A5)
 UNLK A5
 PRINTLINE MESS5XB
 PRINTLINE MESS12;fonction
 LEA TAB_FONCTION,A0
 MOVE D6,D0
 AND #7,D0
 BSR PRINTLINE_TAB
 ADDQ #4,A6
 PRINTLINE MESS7;adresse acc‚d‚e
 MOVE.L (A6)+,D0
 BSR AFF_HEX_LONG_D0
 PRINTLINE MESS13;instruction code
 MOVE.L -18(A6),A0;PC
 MOVE (A0),D0
 BSR AFF_HEX_WORD_D0
\2:PRINTLINE MESS14;SSP
 MOVE.L SAUVE_SSP,D0
 BSR AFF_HEX_LONG_D0
 PRINTLINE MESS15;USP
 MOVE.L SAUVE_USP,D0
 BSR AFF_HEX_LONG_D0
 LEA SAUVE_REG,A1
 LEA 32(A1),A2
 MOVEQ #7,D1
\8:CONOUT #13
  CONOUT #10
  CONOUT #"D"
  MOVEQ #7,D0
  SUB D1,D0
  OR #$30,D0
  MOVE D0,-(SP)
  BSR AFF_NO
  MOVE.L (A1),D0
  BSR AFF_HEX_LONG_D0;registres de donn‚es
  CONOUT #" "
  TST D1
  BEQ.S \9
  CONOUT #"A"
  MOVE (SP),D0
  BSR AFF_NO
  MOVE.L (A2),D0
  BSR AFF_HEX_LONG_D0;registres d'adresses
  CONOUT #" "
\9:ADDQ.L #2,SP
  ADDQ.L #4,A1
  ADDQ.L #4,A2
 DBRA D1,\8
\12:RTS

AFF_NO:

 CONOUT D0
 CONOUT #":"
 CONOUT #"$"
 RTS

PRINTLINE_TAB;tableau point‚ par A0, D0:no du message

 MOVE D0,-(SP)
 MOVEQ #0,D0
\1:CMP.B #-1,(A0)
  BEQ.S \3
  CMP (SP),D0
  BEQ.S \4
\2:TST.B (A0)+
  BNE.S \2
  ADDQ #1,D0
 BRA.S \1
\4:PRINTLINE (A0);affiche le type de l'exception
\3:ADDQ.L #2,SP
 RTS

AFF_HEX_LONG_D0:

 MOVE.L D0,-(SP)
 SWAP D0
 BSR.S AFF_HEX_WORD_D0
 MOVE.L (SP)+,D0

AFF_HEX_WORD_D0:

 MOVE D0,-(SP)
 LSR #8,D0
 BSR.S HEX_D0
 MOVE (SP)+,D0
 BSR.S HEX_D0
 RTS

HEX_D0:

 MOVE D0,-(SP)
 LSR.B #4,D0
 BSR.S \2
 MOVE (SP)+,D0
\2:AND.B #$F,D0
 OR.B #$30,D0
 CMP.B #$3A,D0
 BCS.S \3
 ADD.B #7,D0
\3:AND #$FF,D0
 CONOUT D0
 RTS
 
CONV_DECI:;A0:pointeur cible chaŒne ASCII, D0:valeur sur 32 bits, D1:nombre de chiffres

 BSR CONV_DECI_SIMPLE
 SUBQ #1,D1
 BEQ.S \1
 SWAP D0
 TST D0
 BNE.S \3;d‚passement
 MOVEQ #0,D0
\2:CMP.B #"0",(A0,D0)
  BNE.S \1
  MOVE.B #" ",(A0,D0);enl‚ve les z‚ros inutiles
  ADDQ #1,D0
 CMP D1,D0
 BNE.S \2
 BRA.S \1
\3:MOVE.B #"?",(A0,D1)
 DBRA D1,\3
\1:RTS

CONV_DECI_SIMPLE:;A0:pointeur cible chaŒne ASCII, D0:valeur sur 32 bits, D1:nombre de chiffres

 MOVE D1,-(SP)
 SUBQ #1,D1
 MOVE.L D0,-(SP)
\1:MOVEQ #0,D0
  MOVE (SP),D0
  DIVU #10,D0;poids fort /10
  MOVE D0,(SP);r‚sultat poids fort
  MOVE 2(SP),D0
  DIVU #10,D0;((reste * 65536) + poids faible)/10
  MOVE D0,2(SP);r‚sultat poids faible
  SWAP D0
  OR #$30,D0
  MOVE.B D0,(A0,D1)
 DBRA D1,\1
 ADDQ.L #4,SP
 MOVE (SP)+,D1
 RTS
 
GET_COOKIE:;nom dans D0.L, au retour si < 0 pas de cookie
;retourne le pointeur sur donn‚e cookie dans D0

 MOVEM.L D1-A1/A6,-(SP)
 MOVE.L D0,D6
 SUB.L A6,A6
 SUPER 1
 TST.L D0
 BMI.S \5;mode superviseur
 SUPER 0
 MOVE.L D0,A6;sauve SSP
\5:MOVEQ #0,D7
 MOVE.L _COOKIE,D0
 BEQ.S \1
 MOVE.L D0,A0
\2:TST.L (A0)
  BEQ.S \1
  CMP.L (A0),D6
  BNE.S \3
  MOVE.L A0,D7
  ADDQ #4,D7
  BRA.S \1
\3:ADDQ #8,A0
 BRA.S \2
\1:MOVE.L A6,D0
 BEQ.S \4
 SUPER (A6)
\4:MOVEQ #-1,D6
 MOVE.L D7,D0
 BEQ.S \6
 MOVEQ #0,D6
\6:TST D6
 MOVEM.L (SP)+,D1-A1/A6
 RTS
 
 DATA
 
MESS1:DC.B 13,10,10,27,"p Exception Fault ",27,"q  installed",0
MESS2:DC.B 13,10,"Cycle: ",0
MESS2A:DC.B "Read",0
MESS2B:DC.B "Write",0
MESS3:DC.B 13,10,"EXCEPTION PROCESSING ",0
MESS4:DC.B 13,10,"Fault Status Word (FSLW): ",0
MESS5:DC.B ", Instruction: ",0
MESS5A:DC.B "Yes",0
MESS5B:DC.B "No",0
MESS5X:DC.B ", Size of datas: ",0
MESS5XB:DC.B " bits",0
MESS6:DC.B 13,10,"Format: $",0
MESS7:DC.B 13,10,"Address Fault: $",0
MESS8:DC.B " Cache Register (CACR): $",0
MESS9:DC.B 13,10,"Status Register (SR): $",0
MESS10:DC.B ", bits to 1: ",0
MESS11:DC.B 13,10,"Program Counter (PC): $",0
MESS12:DC.B 13,10,"Fonction: ",0
MESS13:DC.B 13,10,"Code instruction: $",0
MESS14:DC.B 13,10,"Supervisor Stack (SSP): $",0
MESS15:DC.B 13,10,"User Stack (USP): $",0
 
TAB_MESS_EXC:
 DC.B 0
 DC.B 0
 DC.B "Access Fault",0
 DC.B "Address Error",0
 DC.B "Illegal Instruction",0
 DC.B "Integer Zero Divide",0
 DC.B 0
 DC.B 0
 DC.B "Privilege Violation",0
 DC.B "Trace",0
 DC.B "Line A",0
 DC.B "Line F",0
 DC.B "Emulator Interrupt",0
 DC.B 0
 DC.B "Format Error",0
 DC.B "Uninitialised Interrupt",0
 DC.B 0
 DC.B 0
 DC.B 0
 DC.B 0
 DC.B 0
 DC.B 0
 DC.B 0
 DC.B 0
 DC.B "Spurious Interrupt",0
 DC.B "Interrupt level 1",0
 DC.B "Interrupt level 2",0 
 DC.B "Interrupt level 3",0 
 DC.B "Interrupt level 4",0
 DC.B "Interrupt level 5",0 
 DC.B "Interrupt level 6",0
 DC.B "Interrupt level 7",0
 DC.B "Trap #0",0
 DC.B "Trap #1",0
 DC.B "Trap #2",0
 DC.B "Trap #3",0
 DC.B "Trap #4",0
 DC.B "Trap #5",0
 DC.B "Trap #6",0
 DC.B "Trap #7",0
 DC.B "Trap #8",0
 DC.B "Trap #9",0
 DC.B "Trap #10",0
 DC.B "Trap #11",0
 DC.B "Trap #12",0
 DC.B "Trap #13",0
 DC.B "Trap #14",0
 DC.B "Trap #15",0
 DC.B -1
 
TAB_FONCTION:
 DC.B 0,"User datas",0
 DC.B "User program",0
 DC.B 0,0,"Supervisor datas",0
 DC.B "Supervisor program",0
 DC.B "Interrupt/CPU space",0,-1

TAB_STATUS:DC.B "CVZNX   012 MS T"
;               76543210765432107654321076543210
TAB_FSLW1:DC.B "    M LRWSSTTTTTIPSPPIPSWTRWTB S"
TAB_FSLW2:DC.B "    A K  ZZTTMMMOBBTTLFPPWEETP S"
TAB_FSLW3:DC.B "         1010210 EEAB    E  RE E"
 BSS

 ALIGN.W 

 DS.L 128
PILE_CRASH:DS.L 1
VECT_EXC:DS.W 1 
SAUVE_REG:DS.L 16
SAUVE_SSP:DS.L 1
SAUVE_USP:DS.L 1
SAUVE_CACR:DS.L 1
TYPE_CPU:DS.W 1
 
FIN:

 END
       