structure DCOMMAND[ 
	CHECK bit 8	//CHECK BYTE TO GUARANTEE DISK COMMAND 
	HDRCTRL bit 2	//HEADER CONTROL COMMAND 
	LBLCTRL bit 2	//LABEL CONTROL COMMAND
	DATACTRL bit 2	//DATA CONTROL COMMAND
	POSONLY bit 1	//POSITION TO ADDR ONLY 
	DISKCOMPLIMENT bit 1	// COMPLIMENT THE DISK bit IN THE DISK ADDR
	]
  
structure DISKADDR[ 
	SECTOR bit 4	//SECTOR NUMBER 
	TRACK bit 9	//TRACK NUMBER 
	HEAD bit 1	//HEAD NUMBER 
	DISK bit 1	//DISK NUMBER 
	RESTORE bit 1
	]
  
structure DISKSTAT[ 
	SECTOR bit 4	//LAST SECTOR PROCESSED 
	FIN bit 4	//FIN bitS TO TELL ITS DONE
	SEAKFAIL bit 1	//SEAK FAILED 
	SEAKINP bit 1	//SEAK IN PROGRESS 
	NRDY bit 1	//DISK UNIT NOT READY 
	LATE bit 1	//HARDWARE LATE DONT TRUST DATDA
	NOXFER bit 1	//HARDWARE WAS NOT XFERING DATA LAST SECTOR 
	CHKSUM bit 1	//CHECKSUM ERROR , CMMD ALLOWED TO PROCEDE
	STATUS bit 2	// FINAL STATUS 
	]
structure STATBITS[ 
	EOS bit 1
	EOD bit 1
	IOERR bit 1
	IGNOREBITS bit 13
	]
  
structure SN1BITS[
	DIR bit
	RANDOM bit 
	IGNORE bit 14
	]
  
structure STREAMBITS[ 
	DIRTY bit 1
	PUTBACKBIT bit 1 
	SBIGNORE bit 14
	]

//	DEFINE THE BASIC STREAM PREAMBLE FOR BENEFIT OF OTHERS

structure STREAMPREAMBLE[
	SPTR	word	//BUFFER PTR AND OTHER STREAM DEPENDENT THINGS
//	CODE PTRS
	OPENIT	word	// OPEN THE STREAM
	CLOSEIT	word	// CLOSE THE STREAM
	GETIT	word	// GET AN ITEM FROM THE STREAM
	PUTIT	word	// PUT AN ITEM INTO THE STREAM
	RESETIT	word	// RESET THE STREAM
	PUTITBACK word	// PUT AN ITME BACK ONTO THE STREAM
	ERRORIT	word	// ERROR FUNCTION
	ENDOFIT	word	// TRUE IF END-OF-STREAM
	STATEOFIT	word	// RETURN STATE INFO

// STREAM STATE INFO
	STATE word = @STATBITS	//STREAM DEPENDENT
	STREAMSTATE word = @STREAMBITS	// ETC.
	STYPE	word	// STREAM TYPE
	PBITEM	word	// CURRENT PUT-BACK ITEM
	SFID word = STRINGOUT word	// STREAM DEPENDENT
	]

// DEFINE A DISK STREAM!!!!
  
structure [ST 
	@STREAMPREAMBLE
	FN word 1
	[ DCBBLK word 10 ] =
		[ 
		DCBNPTR word 1
		DCBSTATUS@DISKSTAT
		DCBCMMD@DCOMMAND
		DCBHPTR word
		DCBLPTR word 1
		DCBDPTR word 1
		DCBOKINTS word
		DCBERRINTS word
		HEADERBLOCK word 2 =
			[
			DCBHDR1 word
			DCBHDR2 word = CURRENT@DISKADDR
			]
		] 
	[ LABELBLOCK word 8 ] =
		[
		NEXTP@DISKADDR
		BACKP@DISKADDR
		UNUSED word
		NUMCHARS word
		PN word
		VN word = [ VNBITS bit 4; VER bit 12]
		SN1@SN1BITS
		SN2 word
		]
	[ BUF word 1]↑1,PAGESIZE 
	LASTWORD word 1
	]ST
  
// DEFINE A  DISK-LABEL BLOCK 
  
structure DL[ 
	NXTCMMD word	//PTR TO NEXT SUCH BLOCK
	STATUS@DISKSTAT	//DISK CMMD STATUS WHEN COMPLETED
	CMMD@DCOMMAND	// DISK COMMAND TO BE  EXECUTED
	HDRPTR word	//PTR TO HEADER BLOCK
	LBLPTR word	//PTR TO LABEL BLOCK  PORTION
	CMADDR word	//PTR TO MEMORY BUFFER 
	OKINTS word	//OR'ED WITH NWW AFTER OK DISK ACTION
	ERRINTS word	// OR'ED WITH NWW AFTER ERROR ON DISK ACTION

	HEADERBLOCK word 2 =
	[
	HDR1 word	//FIRST word OF HEADER 
	CURRENT @DISKADDR	// 2ND WD OF HEADER.DISK ADDRESS OF PAGE 
	]
	LABELBLOCK word 8 =
		[
		NEXTP@DISKADDR	// PTR TO NEXT PAGE ON DISK
		BACKP@DISKADDR		// PTR TO LAST PAGE ON DISK
		UNUSED word
		NUMCHARS word
		PN word		// PAGE NUMBER
		VN word = [ VNBITS bit 4; VER bit 12] //VERSION NUMBER
		SN1@SN1BITS		// SERIAL NUMBER WD 1
		SN2 word		// SERIAL NUMBER WD 2
		]
	]
  
// DEINE A DISK BLOCK structure--A "PAGE 1" ENTITY
structure DB[ 
	CMMDPTR word =	//PTR TO CURRENT /"DL" BEING EXECUTED 
	     ACTIVE word	//SYNONYM FOR CMMD PTR
	STATUS@DISKSTAT	// CURRENT DISK STATUS 
	DISKADDR@DISKADDR	// ADDR OF CURRENT OR LAST(IF IDLE)CMMD
	]
  
manifest[ STREAMSIZE = (offset LASTWORD)/16 - 1 
	DCBBLKINDEX = (offset DCBBLK)/16 
	HDRBLKINDEX = (offset HEADERBLOCK)/16
	LBLKINDEX = (offset LABELBLOCK)/16
//>>>>DBLKINDEX = (offset DCBDPTR)/16<<<<<< REMOVED!!!!
	BUFINDEX = (offset BUF)/16 - 1	//BACKUP ONE SO INDEXING WORKS OK 
	DLBLINDEX = (offset DL.LABELBLOCK)/16 
	DLSIZE = (offset DL.SN2)/16 + 1	//+1 FOR BLANK
  
	PREAMBLESIZE = offset STREAMPREAMBLE.SFID/16
//	DISPLAYSTREAMSIZE = offset DISP.LAST/16 -1
//	KEYBOARDSTREAMSIZE =  offset KE.LAST/16 -1
//	TTYSTREAMSIZE = KEYBOARDSTREAMSIZE
//	EIAOUTSTREAMSIZE = offset EIAOUT.LAST/16-1
//	EIAINSTREAMSIZE = offset EIAIN.LAST/16-1
	STRINGSTREAMSIZE = PREAMBLESIZE
	OBJPTRSIZE = 16+1	//JUST DEFINE A CONSTANT 
	]
  
// DEFINE A SOURCE-VECTOR structure...
structure SV[ 
	[ BITS bit 1]↑0,15	//"RESERVED" bitS 
	[ PTR word 1]↑0,15	//PTRS TO OBJECTS.
	]
  
// DEFINE AN  FID.  (FILE IDENTIFIER) 
structure FID[
	SN1@SN1BITS
	SN2 word 1 
	VN word 1
	FN word 1
	LA@DISKADDR
	DSN1@SN1BITS 
	DSN2 word 1
	DVN word 1 
	DPN word 1 
	DLA@DISKADDR 
	]
  
manifest[ 
	FIDSIZE = (offset FID.DLA)/16
	]