	.IF	LIST1
	.LIST
	.PAGE
	.ELSE
	.NOLIST
	.ENDC
;****************************************************************************
;
;	Variables & Constants.
;
;	File:	SAGE.BIOS1.TEXT
;	Date:	 1-Aug-83
;	Issue:	2C
;
;
;	COPYRIGHT (c) 1982, 1983 SAGE Computer Technology
;	All Rights Reserved
;
;****************************************************************************
;
;	History:
;
;	1     13-Jun-82 Initial release.
;	1A    20-Jul-82 Documented FI_IBM bits.	 Added BRKOUT flag.
;	1B    23-Jul-82 Added TIMBIAS.
;	1C    29-Jul-82 Added KEYXON.
;	1D    13-Aug-82 Documented another FI_IBM bit.
;	1E    14-Aug-82 Expanded EVENT storage.
;	1F    15-Aug-82 Added IOCONFA & PRTOPT.
;	1G    16-Aug-82 Added TIMADJD, TIMADJS, TIMLAST.
;	1H    23-Aug-82 Added EVENTF, removed EVENTS.
;	1I     4-Sep-82 Added FT_RAWL, changed BIOSLIM to 19.
;	1J    17-Dec-82 Revised variables for motor control.
;			Add entries to Floppy drive information.
;	2     23-Mar-83 Initial SAGE IV release.
;	2A    12-May-83 Changed number of Long TRAPS.
;	2B    17-May-83 Added WT_CRC.
;	2C     1-Aug-83 Removed VCO1-VCO3.  Added indirect call location
;			for SIGEVENT.
;			Changed FT_DONE to FT_BUSY.  Added FT_ASY, WT_WTRY.
;			Added variables and space to Winchester configuration.
;
;****************************************************************************



.PAGE
;****************************************************************************
;
;	Macros:
;
;****************************************************************************

;	Long jump to PROM
	.MACRO	LJMP
	.WORD	4EF9H
	.WORD	00FEH
	.WORD	%1
	.ENDM

.PAGE
;****************************************************************************
;
;	System constants:
;
;****************************************************************************

CR	.EQU	0DH		;ASCII carriage return character
LF	.EQU	0AH		;ASCII line feed character
BELL	.EQU	07H		;ASCII Bell character
XON	.EQU	11H		;Transmit on character
XOFF	.EQU	13H		;Transmit off character


BIOSLIM .EQU	30.		;BIOS function number limit
CHANLIM .EQU	16.		;Normal BIOS channel number limit
USERLIM .EQU	131.		;User Device channel number limit
WI_BTTSZ.EQU	64.		;Number of bad track table entries
WINITL	.EQU	64.+<2*WI_BTTSZ>;Winchester Initialize information length


;****************************************************************************
;
;	Flag bit assignments
;
;****************************************************************************

;	No_Break flag in byte pointed to by NOBREAKP
NOBREAKF.EQU	6		;bit number

;	Flags for Console Terminal (TRMCMD byte)
TRM_BELL.EQU	0		;Bell code flag
TRM_FLSH.EQU	1		;Flush flag
TRM_STOP.EQU	2		;Stop flag
TRM_CMDF.EQU	3		;Flag to apply command register to USART

;	Flags for Remote transmit (ROTFLGS byte)
RO_XOFF .EQU	0		;Flag to send XOFF
RO_XON	.EQU	1		;Flag to send XON
RO_CMDF .EQU	2		;Flag to apply SETROTF & CLRROTF
RO_STOP .EQU	3		;Flag to terminate transmission

;	Flags for Foreground Tasks (FGTASKS word)
FGSCH_B .EQU	0		;Flag for scheduler task
FGEVNT_B.EQU	1		;Flag to perform EVENT signaling
FGFLOP_B.EQU	2		;Flag for floppy tasks
FGRMTD_B.EQU	3		;Flag to set up delay before next Remote xmit
FGKYLD_B.EQU	4		;Flag to set up lockout delay for keyboard
FGRMLD_B.EQU	5		;Flag to set up lockout delay for Remote
FGWIN_B .EQU	6		;Flag for winchester tasks
FGMASK	.EQU	007FH		;Master mask for all foreground flags

;	Delays in floppy disk driver
DLY1	.EQU	236.		;1 Millisecond delay for FDCMD & FDSTAT
DLY2	.EQU	8.		;12 Microsecond delay for FDCMP & FDSTAT &
				;   FDREAD.

;****************************************************************************
;
;	Floppy drive information offsets.
;
;	Allocates 36. bytes for each drive
;
;****************************************************************************

;	First 32 bytes are configuration information
FI_SIDE .EQU	0		;Number of sides (1 byte)
				;No drive = 0, Single sided = 1,
				;Double sided = 2
FI_NCYL .EQU	FI_SIDE+1	;Number of cylinders (1 byte)
FI_SPT	.EQU	FI_NCYL+1	;Number of sectors per track (1 byte)
FI_GAP3 .EQU	FI_SPT+1	;Gap 3 parameter for controller (1 byte)
FI_SKEW .EQU	FI_GAP3+1	;Track to track skew (1 byte)
FI_DTL	.EQU	FI_SKEW+1	;Data Length factor (1 byte)
FI_BPS	.EQU	FI_DTL+1	;Number of bytes per sector (2 bytes)
FI_MODLY.EQU	FI_BPS+2	;Motor On delay (2 bytes)
FI_STEP .EQU	FI_MODLY+2	;Step rate (1 byte - must be on word boundry)
FI_HLOAD.EQU	FI_STEP+1	;Head load time (1 byte - must follow FI_STEP)
FI_MFM	.EQU	FI_HLOAD+1	;MFM (double density) flag (1 byte)
FI_IBM	.EQU	FI_MFM+1	;IBM track format flag (1 byte)
				;  Bit 0 is for IBM track format.
				;  Bit 1 is for "Network Consulting" sector
				;		numbering scheme (9 to 18).
				;  Bit 2 is for Read after Write.
FI_RTRY .EQU	FI_IBM+1	;Retry count (1 byte)
FI_IGNOR.EQU	FI_RTRY+1	;Ignore errors flag (1 byte)
FI_SOFTE.EQU	FI_IGNOR+1	;Soft error counter (1 byte)
FI_DBSTP.EQU	FI_SOFTE+1	;Double step flag (1 byte)
FI_FORPT.EQU	FI_DBSTP+1	;Format pattern (1 byte)
FI_GAP3F.EQU	FI_FORPT+1	;Gap 3 for formatting (1 byte)
FI_FERR .EQU	FI_GAP3F+1	;First recorded error (1 byte)
FI_LERR .EQU	FI_FERR+1	;Last recorded error (1 byte)

;	***  10 unused bytes here for expansion

FI_CCYL .EQU	FI_LERR+11.	;Current cylinder (1 byte)
FI_DRV	.EQU	FI_CCYL+1	;Drive number (1 byte)
FI_SEL	.EQU	FI_DRV+1	;Select state (1 byte)
FI_RCAL .EQU	FI_SEL+1	;Floppy recalibrate status (1 byte)
				;(0 means need to recalibrate)
				;Next location is FI_RCAL+1

;	These variables based from FI_DRVMT (motor control)
;	20 bytes
FI_SCMOT.EQU	0		;Turn motor on/off schedule entry (12 bytes)
FI_HIST .EQU	FI_SCMOT+12.	;Access history codes (4 bytes)
FI_LASTT.EQU	FI_HIST+4	;Last access time (2 bytes)
FI_MOTOR.EQU	FI_LASTT+2	;Motor state (1 byte)
FI_STREQ.EQU	FI_MOTOR+1	;Start request flag (1 byte)


;	Remote configuration
RBAUD	.EQU	0		;Remote baud rate control (2 bytes)
RPARAM	.EQU	RBAUD+2		;Remote USART parameter (1 byte)
REMTYP	.EQU	RPARAM+1	;Remote channel type flag (1 byte)
RMTDTM	.EQU	REMTYP+1	;Remote transmit delay time (2 bytes)
ROTDSR	.EQU	RMTDTM+2	;Flag to check DSR on Remote xmit (1 byte)
				; *** one free byte here ***
;	Remote variables
ROTFLGS .EQU	ROTDSR+2	;Remote output special flags (1 byte)
REMCMD	.EQU	ROTFLGS+1	;USART control byte (1 byte)
ROTGET	.EQU	REMCMD+1	;Remote output buffer Get pointer (1 byte)
ROTPUT	.EQU	ROTGET+1	;Remote output buffer Put pointer (1 byte)
RINGET	.EQU	ROTPUT+1	;Remote input buffer Get pointer (1 byte)
RINPUT	.EQU	RINGET+1	;Remote input buffer Put pointer (1 byte)
RINRUNA .EQU	RINPUT+1	;Remote input runaway interrupt count (1 byte)
RINERR	.EQU	RINRUNA+1	;Remote input error flags (1 byte)
RINSTOP .EQU	RINERR+1	;Remote input stop flag (1 byte)
ROTSETF .EQU	RINSTOP+1	;Flags to set in REMCMD (1 byte)
ROTCLRF .EQU	ROTSETF+1	;Flags to clear in REMCMD (1 byte)
RINLKF	.EQU	ROTCLRF+1	;Remote input lockout request flag (1 byte)
ROTTDF	.EQU	RINLKF+1	;Remote transmit delay request flag (1 byte)
REMCHN	.EQU	ROTTDF+1	;Remote channel type (1 byte)
				; (0 = main board, 1 = extra)
REMEQU	.EQU	REMCHN+1	;Remote channel equipped flag (1 byte)
				; *** One free byte here ***
RIN_FE	.EQU	REMEQU+2	;Remote input framing errors (2 bytes)
RIN_PE	.EQU	RIN_FE+2	;Remote input parity errors (2 bytes)
RIN_OE	.EQU	RIN_PE+2	;Remote input overrun errors (2 bytes)
ROTBUF	.EQU	RIN_OE+2	;Remote output buffer address (4 bytes)
RINBUF	.EQU	ROTBUF+4	;Remote input buffer address (4 bytes)
REMUSD	.EQU	RINBUF+4	;Remote USART data address (2 bytes)
REMUSC	.EQU	REMUSD+2	;Remote USART command address (2 bytes)
RINATCH .EQU	REMUSC+2	;Remote input Attach Number (2 bytes)
ROTATCH .EQU	RINATCH+2	;Remote output Attach Number (2 bytes)
RINSCH	.EQU	ROTATCH+2	;Remote runaway lockout schedule (12 bytes)
ROTSCH	.EQU	RINSCH+12.	;Remote transmit delay schedule (12 bytes)

REMDATSZ.EQU	ROTSCH+12.	;Size of Remote data area

.PAGE
;****************************************************************************
;
;	Winchester Variable offsets
;
;****************************************************************************

;	Configuration information
WI_NCYL .EQU	0		;Number of cylinders (2 bytes)
WI_BPS	.EQU	WI_NCYL+2	;Number of bytes per sector (2 bytes)
WI_STEPT.EQU	WI_BPS+2	;Step time (2 bytes)
WI_SLEWT.EQU	WI_STEPT+2	;Slew time (2 bytes)
WI_STPCT.EQU	WI_SLEWT+2	;Step counter value (2 bytes)
WI_SETLT.EQU	WI_STPCT+2	;Head settle time (2 bytes)
WI_PCOMP.EQU	WI_SETLT+2	;Track for start of Precomp (2 bytes)
WI_STYPE.EQU	WI_PCOMP+2	;Special Drive Type flags (2 bytes)
				;Bit 0 = SyQuest
				;Bit 1 = Ignore head settle
				;Bit 2 = Buffer Seek
WI_TEST .EQU	WI_STYPE+2	;Test flags (2 bytes)
				;Bit 0 - read/write from controller memory
				;  to disk.
				;Bit 1 - stepping test.
				;Bit 2 - read/write from CPU to controller.
				;Bit 3 - Inhibit VCO initialization.
				;Bit 4 - Apply D/A value directly.
				;Bit 5 - Direct Seek.
				;Bit 6 - Recalibrate VCO
				;Bit 7 - Read back drive info
WI_SHIP .EQU	WI_TEST+2	;Shipping track (2 bytes)
WI_HEADC.EQU	WI_SHIP+2	;Header count (2 bytes)
WI_LOWC .EQU	WI_HEADC+2	;Low counter for read (2 bytes)
WI_HIGHC.EQU	WI_LOWC+2	;High counter for read (2 bytes)
WI_HEADS.EQU	WI_HIGHC+2	;Number of heads (1 byte)
WI_SPT	.EQU	WI_HEADS+1	;Number of sectors per track (1 byte)
WI_SELCT.EQU	WI_SPT+1	;Select bit (1 byte)
WI_RTRY .EQU	WI_SELCT+1	;Retry count (1 byte)
WI_FERR .EQU	WI_RTRY+1	;First error code (1 byte)
WI_LERR .EQU	WI_FERR+1	;Last error code (1 byte)
WI_LHERR.EQU	WI_LERR+1	;Last hard error code (1 byte)
WI_SOFT .EQU	WI_LHERR+1	;Soft error count (1 byte)
WI_SKUND.EQU	WI_SOFT+1	;Seek under count (2 bytes)
WI_CRC	.EQU	WI_SKUND+2	;CRC Calculation (2 bytes)
WD_SYNC .EQU	WI_CRC+2	;Sync bit  (2 bytes)
WI_EXHST.EQU	WD_SYNC+2	;Extra Head Settle time (2 bytes)
WI_RAWRT.EQU	WI_EXHST+2	;Read after write retries count (1 byte)
WI_WTRY .EQU	WI_RAWRT+1	;Write cycle retry count (1 byte)

				;*** 16 bytes for future expansion

WI_MAP	.EQU	WI_WTRY+17.	;Track map (64 bytes)
WI_BTTBL.EQU	WI_MAP+64.	;Bad track table ((WI_BTTSZ * 2) bytes)
				
				;One zero word terminates table


;	Operational information
WS_CCYL .EQU	WI_BTTBL+<WI_BTTSZ*2>+2 ;Current cylinder (2 bytes)
WS_RTRK .EQU	WS_CCYL+2	;Track number read from track (2 bytes)
WS_RCAL .EQU	WS_RTRK+2	;Recalibrate request (1 byte)
WS_ERR	.EQU	WS_RCAL+1	;Winchester status error (1 byte)
WS_INIT .EQU	WS_ERR+1	;Drive initialized flag (1 byte)
				
				; *** One free byte here ***


;	I/O request information
WT_LBN	.EQU	WS_INIT+2	;Logical block number (4 bytes)
WT_LENG .EQU	WT_LBN+4	;Transfer length (4 bytes)
WT_MEMA .EQU	WT_LENG+4	;Transfer memory address (4 bytes)
WT_CTRL .EQU	WT_MEMA+4	;Transfer control parameter (2 bytes)
WT_DIR	.EQU	WT_CTRL+2	;Transfer direction (0-read) (1 byte)
WT_CHAN .EQU	WT_DIR+1	;Transfer channel number (1 byte)

;	Temporary I/O request information
WX_LBN	.EQU	WT_CHAN+1	;Logical block number (4 bytes)
WX_LENG .EQU	WX_LBN+4	;Transfer length (4 bytes)
WX_MEMA .EQU	WX_LENG+4	;Transfer memory address (4 bytes)
WX_CTRL .EQU	WX_MEMA+4	;Transfer control parameter (2 bytes)
WX_DIR	.EQU	WX_CTRL+2	;Transfer direction (1 byte)
WX_CHAN .EQU	WX_DIR+1	;Transfer channel number (1 byte)


;	Transfer variables
WT_LTN	.EQU	WX_CHAN+1	;Logical track number (2 bytes)
WT_CYL	.EQU	WT_LTN+2	;Cylinder address (2 bytes)
WT_HEAD .EQU	WT_CYL+2	;Head address (2 bytes)
WT_LEAD .EQU	WT_HEAD+2	;Number of words leading data in track (2 bytes)
WT_NUMB .EQU	WT_LEAD+2	;Number of data words in track (2 bytes)
WT_TRAIL.EQU	WT_NUMB+2	;Number of trailing words in track (2 bytes)
WT_RTRY .EQU	WT_TRAIL+2	;Retry count (1 byte)
WT_WTRY .EQU	WT_RTRY+1	;Write retry count (1 byte)
				;*** one free byte here ***
WT_IMODE.EQU	WT_WTRY+2	;Initialize mode (1 byte)
WT_SKDN .EQU	WT_IMODE+1	;Seek done flag (1 byte)
WT_TYPE .EQU	WT_SKDN+1	;Transfer type (1 byte)
				; 0 = read
				; 1 = read before write
				; 2 = write
				; 3 = read after write
				
WT_CRC	.EQU	WT_TYPE+1	;CRC for write (2 bytes)

WI_SIZE .EQU	WT_CRC+2	;Size of Winchester information area


.PAGE
;****************************************************************************
;
;	Trap Vector Addresses:
;
;****************************************************************************

INITSSP .EQU	 00H		;Initial system stack pointer
INITPC	.EQU	 04H		;Initial program counter

BE_TRAP .EQU	 08H		;Bus error vector
A1_TRAP .EQU	 64H		;Auto Vector #1
A2_TRAP .EQU	 68H		;Auto Vector #2
A5_TRAP .EQU	 74H		;Auto Vector #5
A6_TRAP .EQU	 78H		;Auto Vector #6
T8_TRAP .EQU	0A0H		;TRAP instruction vectors
T9_TRAP .EQU	0A4H
T10_TRAP.EQU	0A8H
T11_TRAP.EQU	0ACH
T12_TRAP.EQU	0B0H
T13_TRAP.EQU	0B4H
T14_TRAP.EQU	0B8H
T15_TRAP.EQU	0BCH

BUGBIOS .EQU	104H		;Flag for Debugger to use BIOS terminal I/O


DEBUG	.EQU	10H		;Debugger entry point


.PAGE
;****************************************************************************
;
;	Peripheral Addresses:
;	
;	All peripheral addresses will be sign extended to 0FFCxxx.
;
;****************************************************************************

TERM_C	.EQU	0C073H		;Terminal USART control port
TERM_S	.EQU	0C073H		;Terminal USART status port
TERM_I	.EQU	0C071H		;Terminal USART character input port
TERM_O	.EQU	0C071H		;Terminal USART character output port

REM_C	.EQU	0C033H		;Auxillary USART #1 control port
REM_S	.EQU	0C033H		;Auxillary USART #1 status port
REM_I	.EQU	0C031H		;Auxillary USART #1 character input port
REM_O	.EQU	0C031H		;Auxillary USART #1 character output port

BRATE	.EQU	0C001H		;Baud rate 8253 base address
BAUD_C	.EQU	0C007H		;8253 baud rate control
BAUD1_D .EQU	0C003H		;Terminal baud rate data
BAUD2_D .EQU	0C005H		;Auxillary port baud rate data

TIMER	.EQU	0C081H		;8253 Timer

DIPSWT	.EQU	0C021H		;DIP switch port

P8259	.EQU	0C041H		;Interrupt encoder
SER8259 .EQU	0C541H		;Interrupt encoder for extra serial ports

F8255	.EQU	0C027H		;8255 for floppy disk control

C8255	.EQU	0C061H		;8255 for centronic port

SI8255	.EQU	0C067H		;8255 for software interrupt

FD_MSR	.EQU	0C051H		;Floppy disk Master Status Register
FD_DATA .EQU	0C053H		;Floppy disk data register

;****************************************************************************
;
;	Winchester Ports
;
;****************************************************************************

WP_DATA .EQU	0C7C1H		;Winchester ram buffer data
WP_DTOA .EQU	0C5C1H		;Winchester D/A converter
WP_PGCC .EQU	0C783H		;Polynomial Generator Checker Command/Status
WP_PGCM .EQU	0C785H		;Polynomial Generator Checker Mode
WP_PGCB .EQU	0C787H		;Polynomial Generator Checker block check
WP_8253 .EQU	0C601H		;Winchester 8253 timer

WP_1A	.EQU	0C581H		;Winchester control port
WP_1B	.EQU	0C583H		;Winchester select port
WP_1C	.EQU	0C585H		;Winchester control port
WP_1CB	.EQU	0C587H		;above port addressed by bit

WP_2A	.EQU	0C501H		;Winchester control port
WP_2B	.EQU	0C503H		;Memory control port
WP_2C	.EQU	0C505H		;Winchester control port
WP_2CB	.EQU	0C507H		;above port addressed by bit

;	Bits on port WP_1A
WB_SKCMP.EQU	0		;Seek complete
WB_TRK0 .EQU	1		;Track 0 indicator
WB_WFALT.EQU	2		;Write fault
WB_INDEX.EQU	4		;Index pulse
WB_READY.EQU	5		;Drive ready flag
WB_WPROT.EQU	6		;Write Protect flag
WB_CHNG .EQU	7		;Cartridge changed flag




;	RAM Storage Area Definition

RAMWORK .EQU	200H		;Defines start of BIOS working storage area

BIOSBASE.EQU	RAMWORK		;Base of total BIOS area with stack (4 bytes)
				;This location is addressed by loaders
				;  and should not be moved.

BIOSADDR.EQU	BIOSBASE+4	;Address of BIOS code in memory (4 bytes)
				;This location is provided for BIOS debugging
				;  and should not be moved.

;	Floppy interrupt routine area
FDIOINT .EQU	BIOSADDR+4	;(26 bytes)


;	Device configuration information
TBAUD	.EQU	FDIOINT+26.	;Terminal baud rate control (2 bytes)
TPARAM	.EQU	TBAUD+2		;Terminal USART control parameter (1 byte)
TRMTYP	.EQU	TPARAM+1	;Terminal type flag (1 byte)

RDISKB	.EQU	TRMTYP+1	;RAM disk base address (4 bytes)
				;(0 means no RAM disk)
RDISKT	.EQU	RDISKB+4	;RAM disk top address (4 bytes)
				;(0 means just below BIOS)
RDISKF	.EQU	RDISKT+4	;RAM disk flags (2 bytes)

PRTPLC	.EQU	RDISKF+2	;Printer poll timeout (2 bytes)
PRTDTM	.EQU	PRTPLC+2	;Printer poll delay (2 bytes)
PRTMODE .EQU	PRTDTM+2	;Printer mode (1 byte)
PRTOPT	.EQU	PRTMODE+1	;Printer options (1 byte)

TIMADJD .EQU	PRTOPT+1	;Time adjustment x days (1 byte)
TIMADJS .EQU	TIMADJD+1	;Time adjustment of seconds per x days (1 byte)

CONFEND .EQU	TIMADJS+1	;End of configuration

			       
;	Foreground & Scheduler variables
FGTASKS .EQU	CONFEND		;Foreground task flags (2 bytes)
CLKOVER .EQU	FGTASKS+2	;Clock overflow word (2 bytes)
SCH_QUE .EQU	CLKOVER+2	;Head of scheduler queue (4 bytes)


;	Console terminal variables
TRMFLGS .EQU	SCH_QUE+4	;Terminal output special flags (1 byte)
TRMCMD	.EQU	TRMFLGS+1	;USART control byte (1 byte)
TRMGET	.EQU	TRMCMD+1	;Terminal output buffer Get pointer (1 byte)
TRMPUT	.EQU	TRMGET+1	;Terminal output buffer Put pointer (1 byte)
KEYGET	.EQU	TRMPUT+1	;Keyboard input buffer Get pointer (1 byte)
KEYPUT	.EQU	KEYGET+1	;Keyboard input buffer Put pointer (1 byte)
KEYRUNA .EQU	KEYPUT+1	;Keyboard runaway interrupt count (1 byte)
KEYBREAK.EQU	KEYRUNA+1	;Keyboard Break flag (1 byte)
KEYXON	.EQU	KEYBREAK+1	;Key for XON (1 byte)

SAGE4	.EQU	KEYXON+1	;SAGE IV flag (1 byte)
				
BREAKV	.EQU	SAGE4+1		;Address of Break routine (4 bytes)
SPECCHAR.EQU	BREAKV+4	;Address of special keyboard chars (4 bytes)
				;Byte 0 - Flush character
				;Byte 2 - Start/Stop character
				;Byte 3 - Break character
NOBREAKP.EQU	SPECCHAR+4	;Address of NoBreak flag (4 bytes)
BRKOUT	.EQU	NOBREAKP+4	;Break out of Driver flag (1 byte)

DISABLE .EQU	BRKOUT+1	;Flag to disable Events (1 byte)
EVENTA	.EQU	DISABLE+1	;Event routine address (4 bytes)
EVENTC	.EQU	EVENTA+4	;Event counter (2 bytes)
EVENTL	.EQU	EVENTC+2	;Last Event number (2 bytes)

				
;	Error Accumulators
KEY_FE	.EQU	EVENTL+2	;Keyboard input framing errors (2 bytes)
KEY_PE	.EQU	KEY_FE+2	;Keyboard input parity errors (2 bytes)
KEY_OE	.EQU	KEY_PE+2	;Keyboard input overrun errors (2 bytes)

;	Printer driver variables
PRTPUT	.EQU	KEY_OE+2	;Printer put pointer (1 byte)
PRTGET	.EQU	PRTPUT+1	;Printer get pointer (1 byte)
PRTTIM	.EQU	PRTGET+1	;Printer timeout flag (1 byte)
PRTCMD	.EQU	PRTTIM+1	;Printer interrupt command flag (1 byte)

FS_SR0	.EQU	PRTCMD+1	;Floppy status register #0 (1 byte)
FS_SR1	.EQU	FS_SR0+1	;Floppy status register #1 (1 byte)
FS_SR2	.EQU	FS_SR1+1	;Floppy status register #2 (1 byte)
FS_CYL	.EQU	FS_SR2+1	;Floppy status - cylinder number (1 byte)
FS_HEAD .EQU	FS_CYL+1	;Floppy status - head number (1 byte)
FS_SECT .EQU	FS_HEAD+1	;Floppy status - sector number (1 byte)
FS_BPS	.EQU	FS_SECT+1	;Floppy status - bytes per sector code (1 byte)
				;0 = 128 BPS, 1 = 256 BPS, 2 = 512 BPS

FS_ISR0 .EQU	FS_BPS+1	;Floppy interrupt status register #0 (1 byte)
FS_ICYL .EQU	FS_ISR0+1	;Floppy sense interrupt cylinder (1 byte)

FS_ERR	.EQU	FS_ICYL+1	;Floppy status error number (1 byte)
FS_INIT .EQU	FS_ERR+1	;Floppy controller init status (1 byte)
				;(0 means need to initialize)

;	Floppy transfer variables
FT_STOP .EQU	FS_INIT+1	;Flag to do stop on floppy not done (1 byte)
FT_BUSY .EQU	FT_STOP+1	;Flag for floppy drive busy (1 byte)
FT_CYL	.EQU	FT_BUSY+1	;Cylinder for transfer (1 byte)
FT_HEAD .EQU	FT_CYL+1	;Head for transfer (1 byte)
FT_SSEC .EQU	FT_HEAD+1	;Starting sector for transfer (1 byte)
FT_TCTR .EQU	FT_SSEC+1	;Current transfer count (2 bytes)
FT_LBN	.EQU	FT_TCTR+2	;Logical Block Number (2 bytes)
FT_LENG .EQU	FT_LBN+2	;Total transfer length (4 bytes)
FT_MEMA .EQU	FT_LENG+4	;Memory address for transfer (4 bytes)

FT_CONT .EQU	FT_MEMA+4	;Floppy process continuation address (4 bytes)
FT_TBLA .EQU	FT_CONT+4	;Current floppy table address (4 bytes)

FTINIT_A.EQU	FT_TBLA+4	;Floppy initialization return address (4 bytes)
FTSEEK_A.EQU	FTINIT_A+4	;Floppy seek return address (4 bytes)
FTRCAL_A.EQU	FTSEEK_A+4	;Floppy seek return address (4 bytes)
FTIO_A	.EQU	FTRCAL_A+4	;Floppy I/O transfer return address (4 bytes)

FT_CTRB .EQU	FTIO_A+4	;Floppy pass transfer byte count (2 bytes)

FTIO_P	.EQU	FT_CTRB+2	;Floppy I/O transfer pass counter (1 byte)
FTINIT_P.EQU	FTIO_P+1	;Floppy initialization pass counter (1 byte)
FTRCAL_P.EQU	FTINIT_P+1	;Floppy recalibrate pass counter (1 byte)
FT_RTRY .EQU	FTRCAL_P+1	;Floppy global retry counter (1 byte)
FT_DIR	.EQU	FT_RTRY+1	;Floppy I/O direction (1 byte) 
				;( 0 = Read, 1 = Write)
FT_PHYS .EQU	FT_DIR+1	;Floppy physical sector request flag (1 byte)
FT_RAWL .EQU	FT_PHYS+1	;Floppy read after write location (1 byte)
FT_ASY	.EQU	FT_RAWL+1	;Floppy asynchronous transfer (1 byte)

TIMBIAS .EQU	FT_ASY+1	;Time Bias (4 bytes)
TIMLAST .EQU	TIMBIAS+4	;Time last set (4 bytes)

IOCONFA .EQU	TIMLAST+4	;I/O Configuration routine address (4 bytes)
				;  (in Interpreter)

;	Global Winchester Driver Information
WG_VARS .EQU	IOCONFA+4	;Winchester driver variables (4 bytes)
WG_CONT .EQU	WG_VARS+4	;Winchester continuation address (4 bytes)
WG_INIT .EQU	WG_CONT+4	;Winchester controller init flag (1 byte)
WG_VCODA.EQU	WG_INIT+1	;VCO setting for D/A converter (1 byte)
WG_VCOF .EQU	WG_VCODA+1	;VCO failure flags (1 byte)
				;Bit 0 - D/A converter to stops
				;Bit 1 - Out of tolerance
				;Bit 2 - Timeout while measuring freq
WG_DONE .EQU	WG_VCOF+1	;Driver done flag (1 byte)
WG_BUSY .EQU	WG_DONE+1	;Driver busy flag (1 byte)
WG_IODN .EQU	WG_BUSY+1	;I/O completion flag (1 byte)

				
;	May be converted to constants later
VCOTOL	.EQU	WG_IODN+1	;VCO tolerance (2 bytes)
VCOCAL	.EQU	VCOTOL+2	;VCO calibration value (2 bytes)
VCOVAL	.EQU	VCOCAL+2	;VCO count value (2 bytes)

SIGEVENT.EQU	VCOVAL+2	;Event signaling routine (6 bytes)

RAMSTOP .EQU	SIGEVENT+6	;Defines end of BIOS storage area
	
	
                                                                                                                                                                                                                                                                                                                