	page
STEPMS:	VFD	4\SRT,4\0	;Step rate **** fixed location ****
bauds	db	7		;Relative port for console
	db	0eeh		;Mode register 1
	db	7eh		;Mode register 2
	db	27h		;Command register
	db	4		;Relative port for lst:
	db	0eeh		;Mode register 1
	db	7eh		;Mode register 2
	db	27h		;Command register
	db	5		;Relative port for ul1:
	db	0eeh		;Mode register 1
	db	7eh		;Mode register 2
	db	27h		;Command register

;	Sector Translation Tables.

XTABLE:	DW	XLTS		;Single 128
	DW	XLTD1		;Double 256
	DW	XLTD2		;Double 512
	DW	XLTD3		;Double 1024

XLTS:	DB	0,6,12,18,24,4,10,16,22,2,8,14,20
	DB	1,7,13,19,25,5,11,17,23,3,9,15,21

XLTD1:	DB	 0, 1,18,19,36,37, 2, 3,20,21,38,39
	DB	 4, 5,22,23,40,41, 6, 7,24,25,42,43
	DB	 8, 9,26,27,44,45,10,11,28,29,46,47
	DB	12,13,30,31,48,49,14,15,32,33,50,51
	DB	16,17,34,35

XLTD2:	DB	 0, 1, 2, 3,16,17,18,19
	DB	32,33,34,35,48,49,50,51
	DB	 4, 5, 6, 7,20,21,22,23
	DB	36,37,38,39,52,53,54,55
	DB	 8, 9,10,11,24,25,26,27
	DB	40,41,42,43,56,57,58,59
	DB	12,13,14,15,28,29,30,31
	DB	44,45,46,47

XLTD3:	DB	 0, 1, 2, 3, 4, 5, 6, 7
	DB	24,25,26,27,28,29,30,31
	DB	48,49,50,51,52,53,54,55
	DB	 8, 9,10,11,12,13,14,15
	DB	32,33,34,35,36,37,38,39
	DB	56,57,58,59,60,61,62,63
	DB	16,17,18,19,20,21,22,23
	DB	40,41,42,43,44,45,46,47
	page
;	Control Blocks for disk drives

DPBASE:
	if	order = 0

	DPHGEN	DSKS1,XLTS,DIRBUF,DPBS1+1	;Drive A:

	DPHGEN	DSKS1,XLTS,DIRBUF,DPBS1+1	;Drive B:

	IF	GBC20
	DPHGEN	DSK8F1,0,DIRBUF,DPBF81+1	;Drive C:

	DPHGEN	DSK8F2,0,DIRBUF,DPBF82+1	;Drive D:

	DPHGEN	DSK8F3,0,DIRBUF,DPBF83+1	;Drive E:
	ENDIF

	IF	GBC10

	DPHGEN	DSK8M1,0,DIRBUF,DPBM81+1	;Drive C:

	DPHGEN	DSK8M2,0,DIRBUF,DPBM82+1	;Drive D:

	ENDIF

	IF	GBC26
	DPHGEN	DSK4S1,0,DIRBUF,DPBS41+1	;Drive C:

	DPHGEN	DSK4S2,0,DIRBUF,DPBS42+1	;Drive D:

	DPHGEN	DSK4S3,0,DIRBUF,DPBS43+1	;Drive E:

	DPHGEN	DSK4S4,0,DIRBUF,DPBS44+1	;Drive F:
	ENDIF
	ENDIF

	if	order = 1

	IF	GBC20
	DPHGEN	DSK8F1,0,DIRBUF,DPBF81+1	;Drive A:

	DPHGEN	DSK8F2,0,DIRBUF,DPBF82+1	;Drive B:

	DPHGEN	DSK8F3,0,DIRBUF,DPBF83+1	;Drive C:
	ENDIF

	IF	GBC10

	DPHGEN	DSK8M1,0,DIRBUF,DPBM81+1	;Drive A:

	DPHGEN	DSK8M2,0,DIRBUF,DPBM82+1	;Drive B:

	ENDIF

	IF	GBC26
	DPHGEN	DSK4S1,0,DIRBUF,DPBS41+1	;Drive A:

	DPHGEN	DSK4S2,0,DIRBUF,DPBS42+1	;Drive B:

	DPHGEN	DSK4S3,0,DIRBUF,DPBS43+1	;Drive C:

	DPHGEN	DSK4S4,0,DIRBUF,DPBS44+1	;Drive D:
	ENDIF

	DPHGEN	DSKS1,XLTS,DIRBUF,DPBS1+1	;Drive D: (GBC20)
						;Drive C: (GBC10)
						;Drive E: (GBC26)

	DPHGEN	DSKS1,XLTS,DIRBUF,DPBS1+1	;Drive E: (GBC20)
						;Drive D: (GBC10)
						;Drive F: (GBC26)


	ENDIF



	space	4,10
;	Disk type definition blocks for each particular mode.

DPBS1:		;Single density, single sided.

	DPBGEN	DSKS1,26,3,7,0,S1DSM,64,1100000000000000b,2


DPBS2:		;Single density, double sided.

	DPBGEN	DSKS2,26,4,15,1,S2DSM,128,1100000000000000b,2*2


DPBD1:		;Double density, single sided.

	DPBGEN	DSKD1,2*26,4,15,0,D1DSM,128,1100000000000000b,2


DPBD2:		;Double density, double sided.

	DPBGEN	DSKD2,2*26,4,15,0,D2DSM,256,1111000000000000b,2*2


DPBD3:		;Double density, single sided.

	DPBGEN	DSKD3,4*15,4,15,0,D3DSM,128,1100000000000000b,2


DPBD4:		;Double density, double sided.

	DPBGEN	DSKD4,4*15,4,15,0,D4DSM,256,1111000000000000b,2*2


DPBD5:		;Double density, single sided.

	DPBGEN	DSKD5,8*8,4,15,0,D5DSM,128,1100000000000000b,2


DPBD6:		;Double density, double sided.

	DPBGEN	DSKD6,8*8,4,15,0,D6DSM,256,1111000000000000b,2*2


	IF	GBC20
DPBF81:		;Fujitsu 20 megabyte first 8 megabytes

	DPBGEN	DSK8F1,8*11,5,31,1,F81DSM,512,1111111111111111b,1*8

DPBF82:		;Fujitsu 20 megabyte second 8 megabytes

	DPBGEN	DSK8F2,8*11,5,31,1,F82DSM,512,1111111111111111b,94*8

DPBF83:		;Fujitsu 20 megabyte first 8 megabytes

	DPBGEN	DSK8F3,8*11,5,31,1,F83DSM,512,1111111111111111b,187*8

	ENDIF

	IF	GBC10
DPBM81:		;Fujitsu 10 megabyte first 5 megabytes

	DPBGEN	DSK8M1,8*11,5,31,1,M81DSM,512,1111111111111111b,1*4

DPBM82:		;Fujitsu 10 megabyte second 5 megabytes

	DPBGEN	DSK8M2,8*11,5,31,1,M82DSM,512,1111111111111111b,123*4

	ENDIF

	IF	GBC26
DPBS41:		;Shugart 26 megabyte first 8 megabytes

	DPBGEN	DSK4S1,8*18,5,31,1,S41DSM,512,1111111111111111b,1*8

DPBS42:		;Shugart 26 megabyte second 8 megabytes

	DPBGEN	DSK4S2,8*18,5,31,1,S42DSM,512,1111111111111111b,57*8

DPBS43:		;Shugart 26 megabyte third 8 megabytes

	DPBGEN	DSK4S3,8*18,5,31,1,S43DSM,512,1111111111111111b,113*8

DPBS44:		;Shugart 26 megabyte last 2 megabytes

	DPBGEN	DSK4S4,8*18,5,31,1,S44DSM,512,1111111111111111b,169*8

	ENDIF

;	Disk selection masks
DSKMSK:
	if	order = 0
mask:	set	0
	maskgen nofdd,1
mask:	set	0
	maskgen ngbc10,2
	maskgen ngbc20,3
	maskgen ngbc26,4
	endif
	if	order = 1
mask:	set	0
	maskgen ngbc10,2
	maskgen ngbc20,3
	maskgen ngbc26,4
mask:	set	0
	maskgen nofdd,1
	endif
