;
; $Id: 80c390.inc,v 1.2 2000/05/18 09:47:42 neil Exp $
; Copyright (C) 2000 Neil Darlow Consulting and Core Technologies.
;
; Dallas 80C390 definitions.
;
		NOLIST

P4		EQU		80H
SP		EQU		81H
DPL		EQU		82H
DPH		EQU		83H
DPL1		EQU		84H
DPH1		EQU		85H
DPS		EQU		86H
PCON		EQU		87H
TCON		EQU		88H
TMOD		EQU		89H
TL0		EQU		8AH
TL1		EQU		8BH
TH0		EQU		8CH
TH1		EQU		8DH
CKCON		EQU		8EH
P1		EQU		90H
EXIF		EQU		91H
P4CNT		EQU		92H
DPX		EQU		93H
DPX1		EQU		95H
C0RMS0		EQU		96H
C0RMS1		EQU		97H
SCON0		EQU		98H
SBUF0		EQU		99H
ESP		EQU		9BH
AP		EQU		9CH
ACON		EQU		9DH
C0TMA0		EQU		9EH
C0TMA1		EQU		9FH
P2		EQU		0A0H
P5		EQU		0A1H
P5CNT		EQU		0A2H
C0C		EQU		0A3H
C0S		EQU		0A4H
C0IR		EQU		0A5H
C0TE		EQU		0A6H
C0RE		EQU		0A7H
IE		EQU		0A8H
SADDR0		EQU		0A9H
SADDR1		EQU		0AAH
C0M1C		EQU		0ABH
C0M2C		EQU		0ACH
C0M3C		EQU		0ADH
C0M4C		EQU		0AEH
C0M5C		EQU		0AFH
P3		EQU		0B0H
C0M6C		EQU		0B3H
C0M7C		EQU		0B4H
C0M8C		EQU		0B5H
C0M9C		EQU		0B6H
C0M10C		EQU		0B7H
IP		EQU		0B8H
SADEN0		EQU		0B9H
SADEN1		EQU		0BAH
C0M11C		EQU		0BBH
C0M12C		EQU		0BCH
C0M13C		EQU		0BDH
C0M14C		EQU		0BEH
C0M15C		EQU		0BFH
SCON1		EQU		0C0H
SBUF1		EQU		0C1H
PMR		EQU		0C4H
STATUS		EQU		0C5H
MCON		EQU		0C6H
TA		EQU		0C7H
T2CON		EQU		0C8H
T2MOD		EQU		0C9H
RCAP2L		EQU		0CAH
RCAP2H		EQU		0CBH
TL2		EQU		0CCH
TH2		EQU		0CDH
COR		EQU		0CEH
PSW		EQU		0D0H
MCNT0		EQU		0D1H
MCNT1		EQU		0D2H
MA		EQU		0D3H
MB		EQU		0D4H
MC		EQU		0D5H
C1RMS0		EQU		0D6H
C1RMS1		EQU		0D7H
WDCON		EQU		0D8H
C1TMA0		EQU		0DEH
C1TMA1		EQU		0DFH
ACC		EQU		0E0H
C1C		EQU		0E3H
C1S		EQU		0E4H
C1IR		EQU		0E5H
C1TE		EQU		0E6H
C1RE		EQU		0E7H
EIE		EQU		0E8H
MXAX		EQU		0EAH
C1M1C		EQU		0EBH
C1M2C		EQU		0ECH
C1M3C		EQU		0EDH
C1M4C		EQU		0EEH
C1M5C		EQU		0EFH
B		EQU		0F0H
C1M6C		EQU		0F3H
C1M7C		EQU		0F4H
C1M8C		EQU		0F5H
C1M9C		EQU		0F6H
C1M10C		EQU		0F7H
EIP		EQU		0F8H
C1M11C		EQU		0FBH
C1M12C		EQU		0FCH
C1M13C		EQU		0FDH
C1M14C		EQU		0FEH
C1M15C		EQU		0FFH

; Bit addressable registers.

; ===== P4 =====
P4_7		EQU		87H
P4_6		EQU		86H
P4_5		EQU		85H
P4_4		EQU		84H
P4_3		EQU		83H
P4_2		EQU		82H
P4_1		EQU		81H
P4_0		EQU		80H

; ===== TCON =====
TF1		EQU		8FH
TR1		EQU		8EH
TF0		EQU		8DH
TR0		EQU		8CH
IE1		EQU		8BH
IT1		EQU		8AH
IE0		EQU		89H
IT0		EQU		88H

; ===== P1 =====
P1_7		EQU		97H
P1_6		EQU		96H
P1_5		EQU		95H
P1_4		EQU		94H
P1_3		EQU		93H
P1_2		EQU		92H
P1_1		EQU		91H
P1_0		EQU		90H

INT5		EQU		97H
INT4		EQU		96H
INT3		EQU		95H
INT2		EQU		94H
TXD1		EQU		93H
RXD1		EQU		92H
T2EX		EQU		91H
T2		EQU		90H

; ===== SCON0 =====
SM0_FE_0	EQU		9FH
SM1_0		EQU		9EH
SM2_0		EQU		9DH
REN_0		EQU		9CH
TB8_0		EQU		9BH
RB8_0		EQU		9AH
TI_0		EQU		99H
RI_0		EQU		98H

; ===== P2 =====
P2_7		EQU		0A7H
P2_6		EQU		0A6H
P2_5		EQU		0A5H
P2_4		EQU		0A4H
P2_3		EQU		0A3H
P2_2		EQU		0A2H
P2_1		EQU		0A1H
P2_0		EQU		0A0H

; ===== IE =====
EA		EQU		0AFH
ES1		EQU		0AEH
ET2		EQU		0ADH
ES0		EQU		0ACH
ET1		EQU		0ABH
EX1		EQU		0AAH
ET0		EQU		0A9H
EX0		EQU		0A8H

; ===== P3 =====
P3_7		EQU		0B7H
P3_6		EQU		0B6H
P3_5		EQU		0B5H
P3_4		EQU		0B4H
P3_3		EQU		0B3H
P3_2		EQU		0B2H
P3_1		EQU		0B1H
P3_0		EQU		0B0H

T1		EQU		0B5H
T0		EQU		0B4H
INT1		EQU		0B3H
INT0		EQU		0B2H
TXD0		EQU		0B1H
RXD0		EQU		0B0H

; ===== IP =====
PS1		EQU		0BEH
PT2		EQU		0BDH
PS0		EQU		0BCH
PT1		EQU		0BBH
PX1		EQU		0BAH
PT0		EQU		0B9H
PX0		EQU		0B8H

; ===== SCON1 =====
SM0_FE_1	EQU		0C7H
SM1_1		EQU		0C6H
SM2_1		EQU		0C5H
REN_1		EQU		0C4H
TB8_1		EQU		0C3H
RB8_1		EQU		0C2H
TI_1		EQU		0C1H
RI_1		EQU		0C0H

; ===== T2CON =====
TF2		EQU		0CFH
EXF2		EQU		0CEH
RCLK		EQU		0CDH
TCLK		EQU		0CCH
EXEN2		EQU		0CBH
TR2		EQU		0CAH
C_T2		EQU		0C9H
CP_RL2		EQU		0C8H

; ===== PSW =====
CY		EQU		0D7H
AC		EQU		0D6H
F0		EQU		0D5H
RS1		EQU		0D4H
RS0		EQU		0D3H
OV		EQU		0D2H
F1		EQU		0D1H
P		EQU		0D0H

; ===== WDCON =====
SMOD_1		EQU		0DFH
POR		EQU		0DEH
EPFI		EQU		0DDH
PFI		EQU		0DCH
WDIF		EQU		0DBH
WTRF		EQU		0DAH
EWT		EQU		0D9H
RWT		EQU		0D8H

; ===== EIE =====
CANBIE		EQU		0EFH
C0IE		EQU		0EEH
C1IE		EQU		0EDH
EWDI		EQU		0ECH
EX5		EQU		0EBH
EX4		EQU		0EAH
EX3		EQU		0E9H
EX2		EQU		0E8H

; ===== EIP =====
CANBIP		EQU		0FFH
C0IP		EQU		0FEH
C1IP		EQU		0FDH
PWDI		EQU		0FCH
PX5		EQU		0FBH
PX4		EQU		0FAH
PX3		EQU		0F9H
PX2		EQU		0F8H

; Masks for byte addressable registers.

; ===== DPS =====
ID1		EQU		80H
ID0		EQU		40H
TSL		EQU		20H
SEL		EQU		01H

; ===== PCON =====
SMOD_0		EQU		80H
SMOD0		EQU		40H
OFDF		EQU		20H
OFDE		EQU		10H
GF1		EQU		08H
GF0		EQU		04H
STOP		EQU		02H
IDLE		EQU		01H

; ===== TMOD =====
; These are for TIMER 0, use value << 4 for TIMER 1.
GATE		EQU		08H
C_T		EQU		04H
M1		EQU		02H
M0		EQU		01H

; ===== CKCON =====
WD1		EQU		80H
WD0		EQU		40H
T2M		EQU		20H
T1M		EQU		10H
T0M		EQU		08H
MD2		EQU		04H
MD1		EQU		02H
MD0		EQU		01H

; ===== EXIF =====
IE5		EQU		80H
IE4		EQU		40H
IE3		EQU		20H
IE2		EQU		10H
CKRY		EQU		08H
RGMD		EQU		04H
RGSL		EQU		02H
BGS		EQU		01H

; ===== P4CNT =====
SBCAN		EQU		40H
P4CNT_5		EQU		20H
P4CNT_4		EQU		10H
P4CNT_3		EQU		08H
P4CNT_2		EQU		04H
P4CNT_1		EQU		02H
P4CNT_0		EQU		01H

; ===== ESP =====
ESP_1		EQU		02H
ESP_0		EQU		01H

; ===== ACON =====
SA		EQU		04H
AM1		EQU		02H
AM0		EQU		01H

; ===== P5 =====
P5_7		EQU		80H
P5_6		EQU		40H
P5_5		EQU		20H
P5_4		EQU		10H
P5_3		EQU		08H
P5_2		EQU		04H
P5_1		EQU		02H
P5_0		EQU		01H

; ===== P5CNT =====
CAN1BA		EQU		80H
CAN0BA		EQU		40H
SP1EC		EQU		20H
C1_IO		EQU		10H
C0_IO		EQU		08H
P5CNT_2	EQU	04H
P5CNT_1	EQU	02H
P5CNT_0	EQU	01H

; ===== C0C/C1C =====
ERIE		EQU		80H
STIE		EQU		40H
PDE		EQU		20H
SIESTA		EQU		10H
CRST		EQU		08H
AUTOB		EQU		04H
ERCS		EQU		02H
SWINT		EQU		01H

; ===== C0S/C1S =====
BUSOFF		EQU		80H
CECE		EQU		40H
WKS		EQU		20H
RXS		EQU		10H
TXS		EQU		08H
ER2		EQU		04H
ER1		EQU		02H
ER0		EQU		01H

; ===== C0IR/C1IR =====
INTIN7		EQU		80H
INTIN6		EQU		40H
INTIN5		EQU		20H
INTIN4		EQU		10H
INTIN3		EQU		08H
INTIN2		EQU		04H
INTIN1		EQU		02H
INTIN0		EQU		01H

; ===== C0M1C-C0M15C/C1M1C-C1M15C =====
MSRDY		EQU		80H
ETI		EQU		40H
ERI		EQU		20H
INTRQ		EQU		10H
EXTRQ		EQU		08H
MTRQ		EQU		04H
ROW_TIH		EQU		02H
DTUP		EQU		01H

; ===== PMR =====
CD1		EQU		80H
CD0		EQU		40H
SWB		EQU		20H
CTM		EQU		10H
X4_X2		EQU		08H
ALEOFF		EQU		04H

; ===== STATUS =====
PIP		EQU		80H
HIP		EQU		40H
LIP		EQU		20H
SPTA1		EQU		08H
SPRA1		EQU		04H
SPTA0		EQU		02H
SPRA0		EQU		01H

; ===== MCON =====
IDM1		EQU		80H
IDM0		EQU		40H
CMA		EQU		20H
PDCE3		EQU		08H
PDCE2		EQU		04H
PDCE1		EQU		02H
PDCE0		EQU		01H

; ===== T2MOD =====
D13T1		EQU		10H
D13T2		EQU		08H
T2OE		EQU		02H
DCEN		EQU		01H

; ===== COR =====
IRDACK		EQU		80H
C1BPR7		EQU		40H
C1BPR6		EQU		20H
C0BPR7		EQU		10H
C0BPR6		EQU		08H
COD1		EQU		04H
COD0		EQU		02H
XCLKOE		EQU		01H

; ===== MCNT0 =====
LSHIFT		EQU		80H
CSE		EQU		40H
SCE		EQU		20H
MAS4		EQU		10H
MAS3		EQU		08H
MAS2		EQU		04H
MAS1		EQU		02H
MAS0		EQU		01H

; ===== MCNT1 =====
MST		EQU		80H
MOF		EQU		40H
SCB		EQU		20H
CLM		EQU		10H

		LIST
