;		    **	TITLE 	DSKPARM.V2 (02.42 12/14/82)  **
	LST	NPRT
;
;	MASTER DOS PARAMETER TABLES
;
; 00.00 07/??/77 RLR
; 01.01 05/30/78 RLR
; 01.02 10/01/78 RLR
; 02.00 01/01/80 rlr
; 02.10 06/17/80 KRS
; 02.14 07/??/80 KRS
; 02.20 07/??/80 KRS
; 02.23 09/??/80 KRS
; 02.36 02/09/82 kls added missing disk error codes
; 02.39 06/13/82 sbw added new fields end of DUB
;       07/20/82 sbw Still trying
; 02.42 12/14/82 sbw Big directory label
;
SYSTP	EQU	2
;
; URREG-> USER CONTROL BLOCK
;
URHL	EQU	0	; REG'S - HL
URDE	EQU	2	;	  DE
URBC	EQU	4	;	  BC
URPSW	EQU	6	;	  AF
URSTK	EQU	8	;	  SP
URHLX	EQU	10	; ALT REG'S - HL	02.14
URDEX	EQU	12	;	      DE	02.14
URBCX	EQU	14	;	      BC	02.14
URPSWX	EQU	16	;	      AF	02.14
URIX	EQU	18	;	X REG		02.14
URIY	EQU	20	;	Y REG		02.14
URDEV	EQU	22	; MASTER DEVICE	
URDBF	EQU	23	; DISK BUFFER ADR
URDRB	EQU	25	; DIRECTORY BLOCK (1..64)
URSFB	EQU	26	; SEARCH FCB ADDRESS
URCHR	EQU	28	; INPUT CHAR BUFFER
URABT	EQU	29	; ABORT ADRRESS
URSKQ	EQU	31	; STACK SWITCH (0-SYS/FF-USER)
URPRC	EQU	32	; PROGRAM RETURN CODE
URTAB	EQU	33	; TAB COUNTER BYTE	02.20
URSOPT	EQU	34	; USER OPTION BYTE	02.20
URSBF1	EQU	35	; SYSTEM BUFFER PTR 1
URSBF2	EQU	37	; SYSTEM BUFFER PTR 2
URFCB	EQU	39	; CHAIN FCB (33 BYTES)
UCBLEN	EQU	URFCB+33
;
; CLKCB:   CLOCK CONTROL BLOCK
; YR	EQU	0
; MON	EQU	1
; DAY	EQU	2
; HOUR	EQU	3  	; 24 HOUR TIME
; MIN	EQU	4
; SEC	EQU	5
;
;  SYSTEM DISK TABLE -> MAX DISKS
;	MAX DISKS * CURRENT SDT ENTRY
;
SDTFB	EQU	0	; FLAG BITS (1)
SDTSB	EQU	1	; STATUS BITS  (1)
SDTUN	EQU	2	; UNIT NUMBER  (1)
SDTTK	EQU	3	; TRACK NUMBER (1)
SDTCSZ	EQU	4	; CLUSTER SIZE (1)
SDTDUB	EQU	5	; DUCB (UNIT CONTROL BLK) (2)
SDTMDR	EQU	7	; MASTER DIR START BLK (2)
SDTMLN	EQU	9	; MSTR DIR LENGTH (ENTRIES) (1)
SDTMCL	EQU	10	; MSTR DIR LENGTH (CLUSTERS)(1)
SDTDTY	EQU	11	; CURR DIR TYPE	 (1)
SDTNAM	EQU	12	; DISK VOLUME NAME (8)
SDTMAP	EQU	20	; ALLOCATION MAP PTR  <CLUSTRS*8> (2)
SDTPTR	EQU	22	; SPECIAL AREA POINTER	  (2)
SDTCPR	EQU	24	; CURR DIR PTR (2)
SDTNCL	EQU	26	; NUMBER OF CLUSTERS ON DISK (2)
;
SDTLEN	EQU	28
;
; DISK UNIT [CONTROL] BLOCK <-
;		CURRENT DUCB POINTER(CDUCB)
;
DUBSIZ	EQU	0	; MAXIMUM SECTORS (3)
DUBSUR	EQU	3	; BLOCKS PER SURFACE (2)
DUBTRK	EQU	5	; BLOCKS PER TRACK (1)
DUBSEC	EQU	6	; Single density blocks (or 1)		;02.39
DUBITB	EQU	7	; INTERLEAVING TABLE
			; (0=NONE, -1=IBM) (2)
DUBSET	EQU	9	; @SET HEAD ROUTINE
DUBIO	EQU	11	; @IO ROUTINE
DUBSPC	EQU	13	; @SPECIAL FUNCTION ROUTINE
DUBSTK	EQU	15	; If DUBSEC<>1 - # of sd trks		;02.39
DUBSSC	EQU	16	; If DUBSEC<>1 - secs per sd trk	;02.39
;
;	FILE CONTROL BLOCK
;
FCBFT	EQU	9	; FILE TYPE
FCBEX	EQU	12	; FILE EXTENT
FCBDE	EQU	14	; DIRECTORY ENTRY NUMBER
FCBRC	EQU	15	; RECORD COUNT
FCBDM	EQU	16	; DISK MAP
FCBNR	EQU	32	; NEXT RECORD
FCBRR	EQU	33	; RANDOM RECORD (CP/M 2.0)	 02.20
;
;  DIR BYTE 0 FLAGS IN BIG DIRECTORY
;
BIGFLG	EQU	02H	; FILE IS BIG FILE		 02.14
WHALF	EQU	04H	; WHICH DM HALF IS IN FCB	 02.14
BIGFIL	EQU	02H	; THIS ENTRY IS BIG FILE	 02.14
biglbl	equ	85h	; Big directory label			;02.42
archive	equ	04h	; Archive attribute			;02.42
;
;  SDT.DIRTYP FLAGS
;
BIGDIR	EQU	01H	; THIS DIR IS BIG DIR
BIGONLY	EQU	02H	; THIS UNIT MUST HAVE A BIG DIR	 02.23
SUBDIR	EQU	80H	; THIS IS A SUB-DIRECTORY
DBLDIR	EQU	40H	; THIS IS A DOUBLE-SIDED DISKETTE
LBLDIR	EQU	10H	; THIS DISK HAS A LABEL		 02.20
;
;****** END OF DOSPARM ******
;
;
DSDT	MAC
[	DW	&1	; TOTAL BLOCKS (L,H)
	DB	&2	; TOTAL BLOCKS (H2)
	DW	&3	; BLOCKS/SURFACE
	DB	&4	; BLOCKS/TRACK
	DB	1	; SD blocks ;02.39
	DW	&6	; INTERLEAVING
	DW	&7	; SET, I/O, SPECIAL FUNCTION
]
;
RGRM	MAC
[	RAM		; V1/V2 RAM, MULTI NO-OP
]
;
; Single density FLOPPY DUB: 
;	SURFACES, TRACKS, SECTORS,
;		INTERLEAVING, [SET,I/O, SPEC]
;
FP1DUB	MAC
[	DW	&1*&2*&3 ; TOTAL BLOCKS (L,H)
	DB	0	; Floppy disk
	DW	&2*&3	; BLOCKS/SURFACE
	DB	&3	; BLOCKS/TRACK
	DB	1	; Flag no DUBSTK or DUBSSC fields	;02.39
	DW	&4	; INTERLEAVING
	DW	&5	; SET, I/O, SPECIAL FUNCTION
]
;
;
; Double density FLOPPY DUB: 
;	SURFACES, TRACKS, SECTORS,
;		INTERLEAVING, [SET,I/O, SPEC], SD tracks, Secs per SD track
;
; Single density blocks is SD tracks * Secs per SD track
;
; Block per surface is
;
;	(Tracks - SD Tracks)*Sectors + (SD Blocks)
;
; Total size is Blocks per surface * Surfaces
;
FPDDUB	MAC
[sd&0	equ	&6*&7			; Single density blocks
ss&0	equ	((&2-&6)*&3)+(sd&0)	; Blocks per surface
	DW	ss&0*&1			; TOTAL BLOCKS (L,H)
	DB	0			; Floppy disk
	DW	ss&0			; BLOCKS/SURFACE
	DB	&3			; BLOCKS/TRACK
	DB	sd&0			; Single density blocks
	DW	&4			; INTERLEAVING
	DW	&5			; SET, I/O, SPECIAL FUNCTION
	db	&6			; SD tracks
	db	&7			; Sectors per SD track
]
;
; DISK ERROR CODES
;
DE$XERR	equ	-2	; system type for extended errors
DE$NRDY	EQU	81H	; NOT READY
DE$HOME	EQU	82H	; HOME
DE$SEEK	EQU	83H	; SEEK
DE$READ	EQU	84H	; READ
DE$WRIT	EQU	85H	; WRITE
;
DE$VRFY	EQU	86H	; 02.36 VERIFY (READ AFTER WRITE)
DE$ILBK	EQU	87H	; 02.36 ILLEGAL BLOCK NUMBER
DE$ILCM	EQU	88H	; 02.36 ILLEGAL COMMAND
DE$WRPT	EQU	89H	; 02.36 DISK IS WRITE PROTECTED
;
DE$SPEC	EQU	80H	; 02.36 SPECIAL (HL --> MSG)
;
	LST	NASC,PRT
;
