; DaffEQs.d
; Last modified by Diebert October 7, 1983  8:57 AM
;
; This file provides the basic equates and
; other goodies for the Daffodil i80186 IOP.

; i80186 Internal Control Block

ICBbase		EQU	0FF00h


; i80186 Chip selects

UMCSreg		EQU	ICBbase + 0A0h
LMCSreg		EQU	ICBbase + 0A2h
MMCSreg		EQU	ICBbase + 0A6h
MPCSreg		EQU	ICBbase + 0A8h
PACSreg		EQU	ICBbase + 0A4h

UMCSval		EQU	0FC39h	; Base @ 0FC000h, 1 WS
LMCSval		EQU	003F9h	; Base @ 000000h, 1 WS
MPCSval		EQU	082B9h	; 16k mid mem, I/O space, 1 WS
MMCSval		EQU	0F9F9h	; Base @ 0F8000h, 1 WS
PACSval		EQU	00039h	; PeriphBase @ 0, 1 WS


PeriphBase	EQU	0

; Communication line equates (i8274)
comData		EQU	PeriphBase + 008h
comCtl		EQU	PeriphBase + 00Ch
comBRCtl	EQU	ICBbase + 05Eh
comBRMaxCntB	EQU	ICBbase + 05Ch
comBRMaxCntA	EQU	ICBbase + 05Ah
comBRCnt	EQU	ICBbase + 058h
comICtl		EQU	ICBbase + 03Ch

comRxAvail	EQU	01h	; RR0 A chan.
comIntPending	EQU	02h	; RR0 A chan.
comTxEmpty	EQU	04h	; RR0 A chan.
comCD		EQU	08h	; RR0 A chan.
comCTS		EQU	20h	; RR0 A chan.
comTxUnderrun	EQU	40h	; RR0 A chan.
comBreak	EQU	80h	; RR0 A chan.
comRxOverrun	EQU	20h	; RR1 A chan.
comParityError	EQU	10h	; RR1 A chan.
comAllSent	EQU	01h	; RR1 A chan.
comRI		EQU	08h	; RR0 B chan.
comDSR		EQU	20h	; RR0 B chan.

icom		EQU	14	; Com chip interrupt


; keyboard equates (i8274)
keyData		EQU	PeriphBase + 00Ah
keyCtl		EQU	PeriphBase + 00Eh
keyBRCtl	EQU	ICBbase + 056h
keyBRMaxCntB	EQU	ICBbase + 054h
keyBRMaxCntA	EQU	ICBbase + 052h
keyBRCnt	EQU	ICBbase + 050h
keyICtl		EQU	ICBbase + 03Ch

keyRxAvail	EQU	01h
keyRxOverrun	EQU	20h

ikey		EQU	14	; Com chip interrupt


; Froppy Disk equates (i8272)
fdStatus	EQU	PeriphBase + 010h
fdData		EQU	PeriphBase + 012h
fdDMAack	EQU	PeriphBase + 018h
fdTermCnt	EQU	PeriphBase + 028h
fdDMACtl	EQU	ICBbase + 0CAh
fdDMATC		EQU	ICBbase + 0C8h
fdDMADPhi	EQU	ICBbase + 0C6h
fdDMADPlo	EQU	ICBbase + 0C4h
fdDMASPhi	EQU	ICBbase + 0C2h
fdDMASPlo	EQU	ICBbase + 0C0h
fdDMAICtl	EQU	ICBbase + 034h
fdICtl		EQU	ICBbase + 03Ah

ifdDMA		EQU	10	;floppy disk DMA interrupt
ifd		EQU	13	;floppy disk interrupt


; P chip equates
PchipStb	EQU	PeriphBase
PchipICtl	EQU	ICBbase + 038h

iPchip		EQU	12	;P chip interrupt


; Ether controller equates (ii82586)
etherCA		EQU	PeriphBase + 020h
etherICtl	EQU	ICBbase + 03Eh

iether		EQU	15	;ethernet interrupt


; spare i80186 DMA Control regs.

DMA1Ctl		EQU	ICBbase + 0DAh	;Spare DMA chan
DMA1TC		EQU	ICBbase + 0D8h
DMA1DPhi	EQU	ICBbase + 0D6h
DMA1DPlo	EQU	ICBbase + 0D4h
DMA1SPhi	EQU	ICBbase + 0D2h
DMA1SPlo	EQU	ICBbase + 0D0h
DMA1ICtl	EQU	ICBbase + 036h

iDMA1		EQU	11	;DMA channel 1 interrupt


; spare i80186 Timer Control regs.
TMR2Ctl		EQU	ICBbase + 066h
TMR2MaxCntA	EQU	ICBbase + 062h
TMR2Cnt		EQU	ICBbase + 060h
TMR2ICtl	EQU	ICBbase + 032h

iTMR2		EQU	19	;Timer 2 interrupt


; i80186 Interrupt controller regs.

IntStatus	EQU	ICBbase + 030h
IntReq		EQU	ICBbase + 02Eh
IntInServ	EQU	ICBbase + 02Ch
IntPriMask	EQU	ICBbase + 02Ah
IntMask		EQU	ICBbase + 028h
IntPollStat	EQU	ICBbase + 026h
IntPollReg	EQU	ICBbase + 024h
IntEOI		EQU	ICBbase + 022h


; Processor Interrupt Source types

iDivErr		EQU	0	;Divide Error
iSnglStp	EQU	1	;Single step
iNMI		EQU	2	;non maskable interrupt
iBkpt		EQU	3	;breakpoint
iINTO		EQU	4	;interrupt on overflow
iBounds		EQU	5	;bounds check
iBadOp		EQU	6	;unimplimented opcode
iESC		EQU	7	;escape instruction

; Misc Equates
true		EQU	0FFFFh
false		EQU	0

; System memory sizes
RamStart	EQU	0	; Start at Absolute 0
RamSize		EQU	16384	; 16K bytes
StackSize	EQU	256	; 256 bytes
RomStart	EQU	0FC00h	; Start at absolute FFC00h
RomSize		EQU	16384	; 16K bytes