/RLFRMT: RL01 DISK PACK FORMATTER
/
/
/
/
/
/
/
/
/
/COPYRIGHT  (C)  1977 BY DIGITAL EQUIPMENT CORPORATION
/
/
/
/
/
/
/
/
/
/
/THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE
/AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
/CORPORATION.  DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/FOR ANY ERRORS THAT MAY APPEAR IN THIS DOCUMENT.
/
/THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FURNISHED TO THE PURCHASER
/UNDER A LICENSE FOR USE ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED
/(WITH INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH
/SYSTEM, EXCEPT AS MAY OTHERWISE BE PROVIDED IN WRITING BY DIGITAL.
/
/DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY FOR THE USE
/OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY
/DIGITAL.
/
/
/
/
/
/
/
/
/
/
/RL01 DISK PACK FORMATTING PROGRAM

VERSION=1
PATCH="A&77

/NOTE:
/THIS SOFTWARE WILL RUN ONLY ON PDP-8A,E,F,M!

/EDIT HISTORY:
/2-NOV-77 DAVID SPECTOR: CREATION

/RLFRMT WRITES OS/8 BAD BLOCK LISTS
/ON RL01 DISK PACKS

/BAD BLOCK LIST FORMATS:
/1. FACTORY-DETECTED BAD BLOCKS
/   CYLINDER 377 SURFACE 1 EVEN SECTORS 0-16
/   BYTE	CONTENTS	COMMENTS
/    0		22111000	SERIAL NUMBER:
/    1		?4443332	9876543210 (OCTAL)
/    2		77666555
/    3		?9998887
/    4		?		UNUSED
/    5		?
/    6		?
/    7		?
/   10		CYLINDER	BAD SECTOR ENTRY
/   11		???????D	DOUBLE-DENSITY EXTENSION
/   12		??SECTOR
/   13		???????S	SURFACE BIT
/   ...		...		MORE BAD SECTOR ENTRIES
/   ???		ALL 1'S		TERMINATOR ENTRY

/ NOTE: "?" REPRESENTS UNUSED ITEMS (0)
/2. OS/8 BAD BLOCK LISTS

/2A. DEVICES A AND B
/	CYLINDER 0 SURFACE 0 SECTOR 14
/WORD	CONTENTS
/ 0	IDENTIFICATION CODE (ID)
/ 1	BAD BLOCKS FOR DEVICE A IN ASCENDING ORDER
/...	...
/20	0 (TERMINATOR FOR LIST)
/21	BAD BLOCKS FOR DEVICE B IN ASCENDING ORDER
/...	...
/40	0 (TERMINATOR FOR LIST)

/2B. DEVICE C
/	CYLINDER 0 SURFACE 0 SECTOR 16
/WORD	CONTENTS
/ 0	IDENTIFICATION CODE (ID)
/ 1	BAD BLOCKS FOR DEVICE C IN ASCENDING ORDER
/...	...
/20	0 (TERMINATOR FOR LIST)
/100-177	ID CODE

/3. INTERNAL TRACK-SECTOR FORMAT:
/WORD 0: TRACK
/WORD 1: SECTOR
/TERMINATOR: NEGATIVE TRACK WORD

/4. INTERNAL OS/8 FORMAT:
/WORD 0: DEVICE (0=A, 1=B, 2=C)
/WORD 1: BLOCK NUMBER
/TERMINATOR: NEGATIVE DEVICE WORD

/	+-------------------------------+
/	!				!
/	!	      NOTE		!
/	!				!
/	!  REFER TO THE DOCUMENT "RL01	!
/	!  SUPPORT  UNDER  OS/8"   FOR	!
/	!  FURTHER INFORMATION.		!
/	!				!
/	!				!
/	+-------------------------------+
/INSTRUCTIONS THAT GENERATE CONSTANTS

AC0001=CLA IAC
AC0002=CLA CLL CML RTL
AC0003=CLA CLL CML IAC RAL	/*
AC0004=CLA CLL IAC RTL		/*
AC0006=CLA CLL CML IAC RTL	/*
AC0100=CLA IAC BSW		/*
AC2000=CLA CLL CML RTR
AC3777=CLA CLL CMA RAR
AC4000=CLA CLL CML RAR
AC5777=CLA CLL CMA RTR
AC6000=CLA CLL CML IAC RTR	/*
AC7775=CLA CLL CMA RTL
AC7776=CLA CLL CMA RAL

/* USE ONLY ON VT-78 AND PDP-8A,E,F,M


/PAGE 0 VARIABLES
	AUTO1=10
	AUTO2=11
	AUTO3=12
	AUTO4=13
	TEMP=20
	KEY=21
	INT=22		/RESERVED
	TMP1=23
	TMP2=24
	TMP3=25
	TMP4=26
	TMP5=27
	TMP6=30
	TMP7=31
	DIGIT=32	/DRIVE NUMBER
	DRIVE=DIGIT	/DRIVE VALUE
	FMT=33		/7777 IF FORMATTED DISK
	FAC=34		/7777 IF FACTORY LIST OK

/LOCATIONS WITHIN OS/8
	MON=7605	/FAST MONITOR RETURN FROM RLFRMT

/IDENTIFICATION CODE FOR BAD BLOCK LISTS
	ID=123
/BUFFERS
	FACTRY=4000	/2 PAGES: FACTORY LIST
	AANDB=FACTRY+400	/1 PAGE: OS/8 A&B LISTS
	C=AANDB+200	/1 PAGE: OS/8 C LIST
	X=C+200		/1 PAGE: "DON'T CARE" PAGE
			/(FOR READ-CHECKING)
	OLD=X		/1 PAGE: OLD OS/8 A,B,C
	NEW=X+200	/1 PAGE: NEWLY-FOUND BAD BLOCKS
/RL01 DEFINITIONS

RLIOT=6600
RLDC=RLIOT 0	/CLEAR DEVICE
RLSD=RLIOT 1	/SKIP IF DONE
RLMA=RLIOT 2	/LOAD MEM ADDR
RLCA=RLIOT 3	/LOAD REGISTER "A"
RLCB=RLIOT 4	/LOAD REG "B" AND EXECUTE
RLSA=RLIOT 5	/LOAD SECTOR ADDR
		/RLIOT 6 UNUSED
RLWC=RLIOT 7	/LOAD WORD COUNT
RRER=RLIOT 10	/READ ERROR REG
RRWC=RLIOT 11	/READ WORD COUNT
RRCA=RLIOT 12	/READ REG "A"
RRCB=RLIOT 13	/READ REG "B"
RRSA=RLIOT 14	/READ SECTOR ADDR
RRSI=RLIOT 15	/READ SILO BYTE
		/RLIOT 16 UNUSED
RLSE=RLIOT 17	/SKIP IF ERROR
/RLCB FUNCTION BITS:
	RLMT=0	/MAINTENANCE MODE
	RLRE=1	/RESET DRIVE ERRORS
	RLST=2	/READ STATUS REGS INTO SILO
	RLSK=3	/SEEK
	RLRH=4	/READ HEADER
	RLWR=5	/WRITE
	RLRD=6	/READ
	RLRN=7	/READ WITH NO HEADER CHECK
/BIT DEFINITIONS IN REGISTERS:
BYTE=1000	/BYTE TRANSFER MODE
	*200		/STARTING ADDRESS

	TAD (IDMSG)	/START HERE
	JMS TYPE	/IDENTIFY SELF
RE,	TAD (MSG)	/RESTART HERE.
	JMS TYPE	/ASK FOR DRIVE NUMBER
RE1,	JMS GETKEY	/WAIT FOR KEY
	TAD (-60)	/CONVERT TO DIGIT
	DCA DIGIT
	TAD DIGIT
	AND (7774)	/ALLOW ONLY DRIVES 0-3
	SNA CLA
	JMP FA1
BUIN,	TAD (BDMSG)	/BAD USER INPUT: ADVISE USER.
	JMS TYPE
	JMP RE
FA1,	JMS GETKEY	/WAIT FOR RETURN KEY
	TAD (-15)
	SZA CLA
	JMP BUIN
	TAD DIGIT	/GOOD USER INPUT;
	BSW		/CHANGE DIGIT TO DRIVE NR.
	DCA DIGIT
	JMS CRLF
	AC2000		/SET CURRENT TRACK TO ILLEGAL
	DCA CURTRK	/VALUE IN ORDER TO FORCE A 'READ
			/HEADER' OPERATION THE FIRST
			/TIME "RL01" IS CALLED, SO WE
			/CAN FIND OUT WHERE THE HEAD IS.
	JMS RL01	/READ OS/8 BAD BLOCK LIST
			/(BBL) FOR DEVICES A&B
	    RLRD	/FUNCTION
	    AANDB	/MA
	    0		/TRACK
	    14		/SECTOR
	    JMP FATAL	/ERROR RETURN
	JMS RL01	/NORMAL RETURN: READ OS/8
			/BBL FOR DEVICE C
	    RLRD	/FUNCTION
	    C		/MA
	    0		/TRACK
	    16		/SECTOR
	    JMP FATAL	/ERROR RETURN
	DCA RCTRK	/PERFORM READ-CHECK OF ENTIRE
			/DISK
	TAD (-1000)	/NUMBER OF TRACKS
	DCA TMP2
	TAD (NEW-1)
	DCA AUTO3	/STORAGE FOR BAD ONES FOUND
	TAD (-100)
	DCA BADCNT	/IN CASE ALL ARE "BAD"
RCNEXT,	JMS RCSUB	/READ NEXT TRACK
			/EVEN SECTORS
	CLA IAC
	JMS RCSUB	/ODD SECTORS
	ISZ RCTRK
	ISZ TMP2
	JMP RCNEXT
	STA		/TERMINATE NEW BAD LIST
	DCA I AUTO3
	STA		/READ BAD BLOCK LISTS FROM DISK
			/START WITH FACTORY-DETECTED
			/BAD BLOCK LIST
			/TRY ALL BAD BLOCK LISTS ON LAST
			/TRACK - SET "FAC" TO -1 IF LIST
			/IS READ IN OK, ELSE 0.
			/INITIALLY ASSUME OK.
	DCA FAC
	TAD (-10)	/SET FOR 8 TRIES.
	DCA TMP1
	DCA FACSEC	/EVEN SECTORS, STARTING WITH 0.
FACRD,	JMS RL01	/CALL RL01 TRANSFER SUBROUTINE
			/TO TRY READING FACTORY BAD
			/BLOCK LIST.
	    BYTE RLRD	/FUNCTION WORD
	    FACTRY	/MA
	    777		/TRACK
FACSEC,	    0		/SECTOR
	    JMP FACBAD	/ERROR RETURN
	TAD (FACCTL-1)	/NORMAL RETURN: TEST LIST JUST
			/READ FOR VALIDITY (4 ZEROS IN
			/FACTRY+4, 4 377'S IN FACTRY+374).
	DCA AUTO1
FAC1,	TAD I AUTO1	/LOC FOR VALIDITY TEST.
	SNA		/0 TERMINATES CONTROL LIST.
	JMP FACOK	/MUST BE VALID; CONTINUE.
	DCA AUTO2	/LOC FOR VALIDITY TEST.
	TAD I AUTO1	/VALUE FOR VALIDITY TEST.
	DCA TMP2
	TAD (-4)	/BYTES TO CHECK.
	DCA TMP3
FAC2,	TAD I AUTO2	/CHECK NEXT BYTE.
	AND (377)	/HARDWARE SHOULD DO THIS!
	CIA
	TAD TMP2
	SZA CLA		/VALUE CHECKS OK?
	JMP FACBAD	/NO.
	ISZ TMP3	/YES, DONE?
	JMP FAC2	/NO, CHECK NEXT BYTE.
	JMP FAC1	/YES, DO NEXT TEST IF ANY.

FACBAD,	ISZ FACSEC	/BAD LIST OR I/O ERROR: TRY
			/READING NEXT COPY OF LIST.
	ISZ FACSEC	/INCREMENT SECTOR BY 2.
	ISZ TMP1	/DONE 8 TRIES?
	JMP FACRD	/NO, TRY NEXT LIST.
	DCA FAC		/YES, DECLARE LIST BAD.
FACOK,	JMP CC1		/CONTINUE ON NEXT PAGE

	PAGE
			/CONTINUE FROM PREVIOUS PAGE
CC1,	TAD (-100)	/FIND OUT IF DISK IS ALREADY
	DCA TMP1	/FORMATTED: SET FMT=0 IF NO,
	TAD (C+77)	/FMT=7777 IF YES. LAST 100 OCTAL
	DCA AUTO1	/WORDS OF "C" LIST ARE EQUAL TO
			/ID CODE.
	STA		/ASSUME IT IS FORMATTED
	DCA FMT
PFCLP,	TAD I AUTO1	/SCAN ID CODE LIST
	TAD (-ID)
	SZA CLA
	DCA FMT		/FMT=0 IF UNFORMATTED
	ISZ TMP1	/DONE SCAN?
	JMP PFCLP	/NOT YET
	TAD FMT		/YES - TYPE SERIAL NR
	SZA CLA		/AND WHETHER DISK IS ALREADY
	TAD (FRMMSG-UNFMSG)	/FORMATTED
	TAD (UNFMSG)	/OR NOT.
	JMS TYPE
	TAD FAC		/IF FACTORY LISTS ARE BAD,
	SZA CLA		/TYPE A SPECIAL MESSAGE.
	JMP EE1
	TAD (BDFMSG)	/"FACTORY LIST DESTROYED"
	JMS TYPE
	JMP EE2		/AND SKIP AROUND FACTORY BBL
			/PROCESSING.
EE1,	TAD (SERMSG)	/IF FACTORY LISTS ARE GOOD,
			/PRINT PACK SERIAL NUMBER
	JMS TYPE
	TAD (FACTRY+3)	/ADDR OF MSB
	DCA TMP1
	JMS DPSNH	/DIGITS 9-5
	JMS DPSNH	/DIGITS 4-0
	JMS CRLF
	TAD (FACTRY+7)	/CONVERT FACTORY-DETECTED
	DCA AUTO1	/BAD BLOCK LIST FROM FACTORY
	TAD (FACTRY+7)	/FORMAT (DEC STANDARD 144) TO
	DCA AUTO2	/TRACK/SECTOR FORMAT.
	JMS CONV1
	TAD (FACTRY+7)	/CONVERT FACTORY-DETECTED BAD
	DCA AUTO1	/BLOCK LIST FROM TRACK/SECTOR
	TAD (FACTRY+7)	/FORMAT TO 2-WD OS/8 FORMAT.
	DCA AUTO2
	JMS CONV2
	TAD (FACTRY+10)	/PUT FACTORY-DETECTED BAD BLOCK
	JMS ORDER	/LIST INTO ASCENDING ORDER AND
			/DELETE ANY DUPLICATE BLOCKS
			/CAUSED BY BOTH SECTORS BEING
			/BAD.
	JMS REPORT	/TYPE BAD BLOCK LIST
	    FACMSG	/OF FACTORY-DETECTED
	    FACTRY+10	/BAD BLOCKS.
EE2,	TAD FMT		/IS DISK FORMATTED?
	SNA CLA
	JMP AA		/NO - THERE ARE NO OLD OS/8 LISTS
	TAD (OLD-1)	/YES - TRANSFER OLD OS/8 BAD
	DCA AUTO3	/BLOCK LISTS TO "OLD" LIST AND
	TAD (BBCTL-1)	/CONVERT TO 2-WD OS/8 FORMAT.
	DCA AUTO2
BBTRAN,	TAD I AUTO2	/TRANSFER NEXT LIST (A,B,C)
	SNA
	JMP AB		/DONE
	DCA AUTO1	/LIST ADDRESS
	TAD I AUTO2	/DEVICE CODE
	DCA TMP1
BBTRNA,	TAD I AUTO1	/TRANSFER NEXT ENTRY
	SNA		/(0 IS OS/8 TERMINATOR)
	JMP BBTRAN	/TRY NEXT LIST
	DCA TMP2
	TAD TMP1
	DCA I AUTO3	/STORE DEVICE CODE IN "OLD"
	TAD TMP2
	DCA I AUTO3	/STORE BLOCK IN "OLD"
	JMP BBTRNA	/TRY NEXT ENTRY
AB,	STA		/TERMINATE "OLD" LIST
	DCA I AUTO3
	TAD (OLD)	/ORDER "OLD" LIST
	JMS ORDER
	JMS REPORT	/TYPE BAD BLOCK LIST
	    OLDMSG	/OF OLD OS/8 BLOCKS
	    OLD
AA,	TAD (NEW-1)	/CONVERT NEWLY-FOUND BAD
	DCA AUTO1	/BLOCK LIST FROM TRACK/SECTOR
	TAD (NEW-1)	/FORMAT TO 2-WD OS/8 FORMAT.
	DCA AUTO2
	JMS CONV2
	TAD (NEW)	/ORDER "NEW" LIST
	JMS ORDER
	JMS REPORT	/TYPE BAD BLOCK LIST
	    NEWMSG	/OF NEWLY-FOUND
	    NEW		/BAD BLOCKS.
	TAD FMT		/FORMATTED DISK?
	SNA CLA
	JMP AA1		/NO
	TAD (NEW-1)	/YES: FIND OUT IF THERE ARE
	DCA AUTO1	/ANY NEW BAD BLOCKS NOT LISTED
			/IN THE OLD LIST
	JMP AA2		/CONTINUE ON NEXT PAGE

	PAGE
			/CONTINUE FROM PREVIOUS PAGE
AA2,	TAD (OLD-1)	/EXAMINE NEXT ENTRY IN "NEW"
	DCA AUTO2
	TAD I AUTO1
	SPA
	JMP AA1		/NO MORE ENTRIES IN "NEW"
	DCA TMP1	/DEVICE CODE
	TAD I AUTO1
	DCA TMP2	/BLOCK
	SKP
AA3,	ISZ AUTO2	/SKIP REST OF "OLD" ENTRY
AA4,	TAD I AUTO2	/SCAN "OLD" ENTRIES
			/IS THERE ANOTHER ENTRY?
	SPA
	JMP NEWFND	/NO - A NEW ENTRY WAS FOUND
			/WHICH HAD NO CORRESPONDING OLD
			/ENTRY - TYPE WARNING MESSAGE.
	CIA		/YES - DOES IT EQUAL THE NEW
	TAD TMP1	/ENTRY?
	SZA CLA
	JMP AA3		/NO, CONTINUE SCAN
	TAD I AUTO2	/TEST 2ND WORD OF ENTRY
	CIA
	TAD TMP2
	SZA CLA
	JMP AA4		/NO, CONTINUE SCAN
	JMP AA2		/YES - NEW BLOCK APPEARS IN
			/OLD LIST; TRY NEXT NEW ENTRY.

NEWFND,	CLA		/A REALLY NEW BAD BLOCK
	TAD (ADDMSG)	/HAS BEEN FOUND
	JMS TYPE
AA1,	CLA
	TAD FMT		/IS DISK UNFORMATTED AND ALSO
			/WITHOUT A VALID FACTORY BBL?
	TAD FAC
	SNA CLA
	JMP EE3		/YES TO BOTH - SKIP MERGE PRO-
			/CEDURE SO THAT "NEW" WILL CON-
			/SIST ONLY OF NEWLY-FOUND BAD
			/BLOCKS.
	TAD FMT		/IS DISK FORMATTED?
	SNA CLA
	TAD (FACTRY+7-OLD+1)	/NO: MERGE FACTORY-
			/DETECTED BAD BLOCK LIST
			/INTO NEWLY-FOUND BAD BLOCK
			/LIST
	TAD (OLD-1)	/YES: MERGE OLD OS/8 BAD
			/BLOCKS INTO NEW LIST
	DCA AUTO1
	TAD (NEW-1)
	DCA AUTO2
AB1,	TAD I AUTO2	/FIND END OF "NEW" LIST
	SPA CLA
	JMP AB2		/FOUND END
	ISZ AUTO2	/NOT YET
	JMP AB1
AB2,	STA		/FOUND END; BACKUP POINTER
	TAD AUTO2	/TO POINT TO JUST BEFORE
	DCA AUTO2	/END OF "NEW" LIST
AB4,	TAD I AUTO1	/GET NEXT INPUT ENTRY
	SPA
	JMP AB3		/NO MORE ENTRIES TO MERGE
	DCA I AUTO2	/TACK INPUT ONTO END OF
	TAD I AUTO1	/"NEW" LIST
	DCA I AUTO2
	JMP AB4		/TRANSFER NEXT ENTRY
AB3,	DCA I AUTO2	/DONE MERGE; TERMINATE "NEW"
EE3,	TAD (NEW)	/ORDER "NEW" AND DELETE
	JMS ORDER	/DUPLICATE ENTRIES IF ANY.
	JMS REPORT	/TYPE BAD BLOCK LIST
	    FINMSG	/OF OS/8 BAD BLOCKS ABOUT
	    NEW		/TO BE WRITTEN OUT.
	TAD (AANDB-1)	/NEW LIST IS NOW COMPLETE.
			/PREPARE OS/8 LISTS FOR
			/WRITING ONTO DISK.
			/ZERO EACH LIST
	JMS ZERO
	TAD (C-1)
	JMS ZERO
	TAD (ID)	/STORE ID CODES IN PROPER
	DCA AANDB	/PLACES.
	TAD (ID)
	DCA C
	TAD (C+77)
	DCA AUTO1
	TAD (-100)
	DCA TMP1
	TAD (ID)
	DCA I AUTO1
	ISZ TMP1
	JMP .-3
	TAD (NEW)	/TRANSFER NEW LIST TO PROPER
	DCA TMP3	/OS/8 LISTS PRIOR TO WRITING.
	TAD (BBCTL-1)
	DCA AUTO2
	JMP AD1A	/TRANSFER FIRST LIST (A)
AD1,	CLA		/TRANSFER NEXT LIST (B,C)
	DCA I AUTO3	/TERMINATE LAST LIST (A,B,C)
AD1A,	TAD I AUTO2
	SNA
	JMP ASK		/DONE TRANSFER
	DCA AUTO3	/OS/8 LIST ADDRESS
	TAD I AUTO2
	DCA TMP1	/DEVICE CODE
	TAD (-20)
	DCA TMP2	/COUNTER - ONLY 15 BAD BLOCKS
			/ARE ALLOWED PER DEVICE.
	SKP		/TRANSFER EACH ENTRY, THIS DEV.
AD2,	ISZ TMP3	/LOCATE TO NEXT ENTRY IN "NEW".
	TAD I TMP3	/GET DEV CODE - IS NEW ENTRY
			/SAME DEVICE AS
			/CURRENT OS/8 LIST BEING FILLED?
	SPA
	JMP AD1		/NO MORE ENTRIES IN "NEW"
	CIA		/COMPARE DEVICES
	TAD TMP1
	SZA CLA
	JMP AD1		/DIFFERENT DEVICE; TRANSFER TO
			/NEXT OS/8 LIST.
	JMP AD4		/SAME DEVICE.
			/CONTINUE ON NEXT PAGE

	PAGE
			/CONTINUE FROM PREVIOUS PAGE
AD4,	ISZ TMP3	/LOCATE TO BLOCK NR.
	TAD TMP1	/CHECK TO SEE IF BAD BLOCK IS
			/IN THE RANGE 0-66 OCTAL ON
	SZA CLA		/DEVICE A; IF SO, WARN USER NOT
	JMP AD3		/TO USE AS SYSTEM DEVICE.
	TAD I TMP3
	STL CIA		/13-BIT NEGATE
	TAD (66)	/13-BIT COMPARE
	SZL CLA		/IS BLOCK LE 66?
	JMP AD3		/NO, IT'S OK
	TAD (ZERMSG)	/YES, WARN USER
	JMS TYPE
AD3,	TAD I TMP3	/IGNORE ANY BLOCK ZERO (BLOCK
			/ZERO CANNOT BE REPRESENTED IN
			/OS/8 BAD BLOCK LISTS.)
	SNA
	JMP AD2		/IGNORE ZERO BLOCK
	DCA I AUTO3	/STORE IN OS/8 LIST A,B, OR C
			/(NON-ZERO BLOCK NR)
	ISZ TMP2	/16 BAD BLOCKS, THIS DEVICE?
	JMP AD2		/NO, TRANSFER NEXT ENTRY
	TAD (OVFMSG)	/YES, WARN USER AND QUIT
	JMP ERROR
ASK,	TAD (FMTMSG)	/WAIT FOR USER TO VERIFY
			/GOING AHEAD AND WRITING
			/OUT OS/8 BAD BLOCK LISTS.
			/"FORMAT DISK PACK?"
	JMS TYPE
	JMS GETKEY	/WAIT FOR KEY
	DCA TMP1
	JMS GETKEY	/WAIT FOR RETURN
	TAD (-15)
	SZA CLA
	JMP ASK
	JMS CRLF
	TAD TMP1
	ZZ="Y&177
	TAD (-ZZ)	/TEST FOR "Y" (YES)
	SZA CLA
	JMP RE
	RLDC		/GO-AHEAD RECEIVED: CHECK FOR WRITE-LOCK.
			/CLEAR CONTROLLER.
	TAD (BYTE RLST)
	JMS IO		/DO "GET STATUS" COMMAND.
	    JMP FATAL	/ERROR: CANNOT HAPPEN.
	RRSI		/IGNORE BYTE #1.
	RRSI		/GET BYTE #2.
	BSW		/BIT [40] IS WRITE-LOCK BIT.
	SPA CLA		/IS WRITE-LOCK ENABLED?
	JMS REMOVE	/YES: ASK USER TO DISABLE.
	JMS RL01	/NO: DO ACTUAL FORMATTING.
			/ACTUAL FORMATTING: WRITE
			/OUT ALL OS/8 BAD BLOCK
			/LISTS. CALL INTERNAL HANDLER
			/FOR EACH LIST WRITTEN.
	    RLWR	/FUNCTION=WRITE
	    AANDB	/A AND B LISTS
	    0		/TRACK=0
	    14		/SECTOR=14
	    JMP FATAL	/ERROR RETURN
	JMS RL01
	    RLWR	/FUNCTION=WRITE
	    C		/C LIST
	    0		/TRACK=0
	    16		/SECTOR=16
	    JMP FATAL	/ERROR RETURN
	TAD (DNMSG)	/TYPE "DONE"
	JMS TYPE
	JMP RE		/AND ASK FOR NEXT PACK.



/SUBROUTINE TO ASK USER TO DISABLE WRITE-LOCK
REMOVE,	0
REMOV1,	TAD (WRMSG)
	JMS TYPE
	JMS GETKEY
	TAD (-15)	/WAIT FOR RETURN.
	SZA CLA
	JMP REMOV1	/IGNORE ANY OTHER KEY.
	JMP I REMOVE
/CONVERSION SUBROUTINES

/SUBROUTINE TO CONVERT FROM FACTORY FORMAT (DEC STANDARD 144)
/TO TRACK/SECTOR FORMAT
/INPUT:	AUTO1=INPUT LIST-1
/	AUTO2=OUTPUT LIST-1
CONV1,	0
CONV1A,	TAD I AUTO1	/CYLINDER BYTE
	AND (377)	/HARDWARE SHOULD DO THIS!
	DCA TMP1
	TAD I AUTO1	/DOUBLE DENSITY BIT
	AND (377)	/HARDWARE SHOULD DO THIS!
	CLA		/IGNORE
	TAD I AUTO1	/SECTOR BYTE
	AND (377)	/HARDWARE SHOULD DO THIS!
	DCA TMP2
	TAD I AUTO1	/SURFACE BIT
	AND (377)	/HARDWARE SHOULD DO THIS!
	CLL RAR
	SZA CLA		/TEST FOR END OF LIST
	JMP CONV1B	/DONE
	TAD TMP1	/CONSTRUCT TRACK
	RAL
	DCA I AUTO2	/STORE TRACK
	TAD TMP2
	AND (77)
	DCA I AUTO2	/STORE SECTOR
	JMP CONV1
CONV1B,	STA		/TERMINATE OUTPUT LIST
	DCA I AUTO2
	JMP I CONV1

	PAGE
/SUBROUTINE TO CONVERT FROM TRACK/SECTOR FORMAT
/TO 2-WD OS/8 FORMAT
/INPUT:	AUTO1=INPUT LIST-1
/	AUTO2=OUTPUT LIST-1
CONV2,	0
CONV2C,	TAD I AUTO1
	DCA TMP1	/TRACK
	TAD I AUTO1
	DCA TMP2	/SECTOR
	TAD TMP1	/TEST FOR END OF LIST
	SPA CLA
	JMP CONV2D	/DONE
	TAD TMP2	/TEST FOR DEVICE C
	CLL RAR
	SZL
	JMP CONV2A	/MUST BE A OR B
	TAD (-10)
	SMA CLA
	JMP CONV2A	/MUST BE A OR B
	TAD TMP1	/MUST BE C; TEST FOR ILLEGAL
			/BAD BLOCKS.
	SNA CLA
	JMP CONV2C	/ILLEGAL: TRACK 0; IGNORE
	TAD (-777)
	SNA CLA
	JMP CONV2C	/ILLEGAL: TRACK 777; IGNORE
	TAD TMP2	/CONVERT DEVICE C BLOCK
	CLL RTR
	DCA TMP2	/BITS [3] SO FAR
	TAD TMP1
	AC0002
	DCA I AUTO2	/STORE DEVICE CODE FOR C
	STA
	TAD TMP1
	CLL RTL		/BITS [3774]
	TAD TMP2	/BITS [3777]
CONV2B,	DCA I AUTO2	/STORE BLOCK NUMBER
	JMP CONV2C	/CONVERT NEXT ENTRY
CONV2A,	CLA		/PROCESS DEVICES A AND B
	TAD TMP2	/CONVERT BLOCK NR
	CLL RAR
	SZL
	TAD (24)
	TAD (-10)
	CLL RAR
	DCA TMP2	/BITS [17] SO FAR
	TAD TMP1
	CLL RTL
	RTL		/LINK=DEVICE NR (A=0, B=1)
			/BITS [7760]
	TAD TMP2	/BITS [7777]
	DCA TMP1
	RAL		/GET DEVICE CODE
	DCA I AUTO2	/STORE DEVICE CODE FOR A OR B
	TAD TMP1
	JMP CONV2B	/STORE BLOCK NR

CONV2D,	STA		/TERMINATE OUTPUT LIST
	DCA I AUTO2
	JMP I CONV2

/SUBROUTINE TO ZERO A PAGE CONTAINING AN OS/8 BAD
/BLOCK LIST
/INPUT:	AC=ADDRESS OF LIST-1
ZERO,	0
	DCA AUTO1
	TAD (-200)
	DCA TMP1
	DCA I AUTO1
	ISZ TMP1
	JMP .-2
	JMP I ZERO

/SUBROUTINE TO ORDER A 2-WD OS/8 BAD BLOCK LIST AND
/DELETE DUPLICATE ENTRIES IF ANY
/INPUT:	AC=ADDRESS OF LIST
ORDER,	0
	DCA TMP1
	AC7776
	TAD TMP1
	DCA TMP2	/FOR EACH TMP2, ALL TMP3 WILL
			/BE COMPARED TO DETERMINE
			/MINIMUM VALUE
ORDERA,	AC0002		/FIND MINIMUM OF REMAINING
			/ENTRIES IN LIST
	TAD TMP2
	DCA TMP2
	TAD I TMP2
	SPA CLA
	JMP DD		/DONE; DELETE DUPLICATES
	TAD TMP2	/START WITH CURRENT ENTRY
	DCA TMP3	/AND COMPARE WITH REST
ORDERB,	AC0002		/COMPARE WITH NEXT ENTRY
	TAD TMP3
	DCA TMP3
	TAD I TMP3
	SPA CLA
	JMP ORDERA	/NO MORE REMAINING ENTRIES;
			/ORDER NEXT ENTRY
	TAD I TMP3	/COMPARE DEVICE CODES
	CIA		/12-BIT COMPARE
	TAD I TMP2
	SPA SNA
	JMP ORDERD	/COMPARE 2ND WORD
ORDERC,	CLA		/DISORDERED; INTERCHANGE ENTRIES
	TAD TMP2
	DCA TMP4
	TAD TMP3
	DCA TMP5
	JMS EXCH
	ISZ TMP4
	ISZ TMP5
	JMS EXCH
	JMP ORDERB	/CONTINUE COMPARING TO FIND
			/MINIMUM ENTRY

/RETURN FROM "ORDER"
DD2,	DCA I TMP2	/STORE TERMINATOR
	JMP I ORDER	/AND RETURN

/SUBROUTINE TO INTERCHANGE TWO ENTRIES
EXCH,	0
	TAD I TMP4
	DCA TMP6
	TAD I TMP5
	DCA I TMP4
	TAD TMP6
	DCA I TMP5
	JMP I EXCH

	PAGE
/CONTINUATION OF ORDERING SUBROUTINE
ORDERD,	SZA CLA		/COMPARE DEVICE CODES
	JMP ORDERB	/ALREADY ORDERED OK
	TAD TMP2	/PREPARE TO COMPARE 2ND WORD
	DCA AUTO2	/(BLOCK NR)
	TAD TMP3
	DCA AUTO3
	TAD I AUTO3
	STL CIA		/13-BIT NEGATE
	TAD I AUTO2	/13-BIT COMPARE
	SNL SZA
	JMP ORDERC	/DISORDERED; INTERCHANGE
	SZA CLA
	JMP ORDERB	/ALREADY ORDERED OK
	AC2000		/DEVICE CODE AND BLOCK NR
			/BOTH EQUAL: A DUPLICATE ENTRY!
			/SET EARLIER COPY TO SPECIAL
			/VALUE (2000); LATER IT WILL
			/BE DELETED FROM LIST.
	DCA I TMP2
	JMP ORDERA	/CONSIDER IT ORDERED AND
			/ORDER NEXT ENTRY.
DD,	TAD TMP1	/LIST IS NOW ORDERED. SCAN
			/LIST, COMPRESSING OUT ANY
			/"2000" VALUES (DUPLICATE
			/ENTRIES).
			/INITIAL OUTPUT IS INPUT
	DCA TMP2
DD1,	TAD I TMP1	/SCAN NEXT ENTRY
	SPA
	JMP DD2		/DONE
	TAD (-2000)	/TEST FOR DUPLICATE
	SZA CLA
	JMP DD3		/NO - COPY OVER
	ISZ TMP1	/YES - IGNORE IT
	ISZ TMP1
	JMP DD1
DD3,	TAD I TMP1	/COPY OVER INPUT TO OUTPUT
	DCA I TMP2	/TO COMPRESS LIST.
	ISZ TMP1
	ISZ TMP2
	TAD I TMP1
	DCA I TMP2
	ISZ TMP1
	ISZ TMP2
	JMP DD1		/SCAN NEXT ENTRY
/SUBROUTINE TO REPORT (TYPE) A BAD BLOCK LIST
REPORT,	0
	TAD (-4-1)	/MAX ENTRIES ON FIRST LINE
	DCA TMP2
	TAD I REPORT	/ADDR OF HEADING MESSAGE
	JMS TYPE
	TAD (BBMSG)	/"BAD BLOCKS:"
	JMS TYPE
	ISZ REPORT
	TAD I REPORT	/ADDRESS OF LIST
	DCA TMP1
	ISZ REPORT
	TAD I TMP1	/IS LIST NULL?
	SMA CLA
	JMP REP2	/NO
	TAD (NNMSG)	/YES - TYPE "NONE"
	JMS TYPE
REP3,	JMS CRLF	/DONE
	JMP I REPORT
REP2,	TAD I TMP1	/TYPE NEXT ENTRY
	SPA CLA
	JMP REP3	/NONE - DONE
	ISZ TMP2	/IS OUTPUT LINE FILLED?
	JMP REP4	/NO
	TAD (-10)	/YES, PRINT CRLF
			/MAX ENTRIES ON SUCCEEDING LINES
	DCA TMP2
	JMS CRLF
REP4,	TAD I TMP1	/VALID ENTRY: TYPE IT
	TAD ("A)	/CONVERT DEVICE CODE TO
			/DEVICE LETTER AND TYPE IT.
	JMS PRINT	/"A","B","C"
	JMS PRINTB	/SPACE
	ISZ TMP1
	TAD I TMP1	/BLOCK NR
	JMS PRINTN	/PRINT AS OCTAL NR
	JMS PRINTB	/2 SPACES
	JMS PRINTB
	ISZ TMP1	/NEXT ENTRY
	JMP REP2	/TYPE NEXT ENTRY
/SUBROUTINE TO PRINT 5 DIGITS OF SERIAL NUMBER
DPSNH,	0
	TAD I TMP1
	RAR
	JMS DPSNT	/DIGITS 9-8, 4-3
	TAD I TMP1
	RAR		/LINK=MSB OF DIGIT 7 OR 2
	STA CML		/BACKUP BYTE POINTER AND
			/CORRECT LINK FOR OVERFLOW.
	TAD TMP1
	DCA TMP1
	RTL		/LINK TO BIT [4].
	RAL
	DCA TMP2
	TAD I TMP1
	BSW
	AND (3)		/BITS [3].
	TAD TMP2	/BITS [7].
	JMS DPSND	/DIGIT 7, 2
	TAD I TMP1
	JMS DPSNT	/DIGITS 6-5, 1-0
	STA
	TAD TMP1
	DCA TMP1
	JMP I DPSNH

/SUBROUTINE TO PRINT 2 DIGITS OF SERIAL NUMBER
DPSNT,	0
	DCA TMP2
	TAD TMP2
	RTR
	RAR
	JMS DPSND	/2ND SIG. DIGIT
	TAD TMP2
	JMS DPSND	/1ST SIG. DIGIT
	JMP I DPSNT

/SUBROUTINE TO PRINT OCTAL DIGIT
DPSND,	0
	AND (7)
	TAD ("0)
	JMS PRINT
	JMP I DPSND

	PAGE
/FATAL I/O ERROR ROUTINE
FATAL,	TAD (FAMSG)
	JMP ERROR	/"FATAL I/O ERROR" AND QUIT.

/SUBROUTINE TO READ-CHECK EVEN OR ODD SECTORS
/ON ONE TRACK
RCSUB,	0
	DCA RCSECT
	TAD (-24)	/NUMBER OF SECTORS
	DCA TMP1
RCLOOP,	JMS RL01	/PERFORM READ
	RLRD
	X		/MA (DON'T CARE)
RCTRK,	0		/TRACK
RCSECT,	0		/SECTOR
	JMS RCBAD	/ERROR RETURN: ADD BLOCK
			/TO "NEW" BAD BLOCK LIST
	ISZ RCSECT	/NORMAL RETURN: INCREMENT
	ISZ RCSECT	/SECTOR
	ISZ TMP1
	JMP RCLOOP
	JMP I RCSUB	/DONE

/SAVE TRACK/SECTOR OF NEWLY-FOUND BAD BLOCK
RCBAD,	0
	TAD RCTRK
	DCA I AUTO3
	TAD RCSECT
	DCA I AUTO3
	ISZ BADCNT	/ONLY ALLOW 64
	JMP I RCBAD
	TAD (TOOMSG)	/OVER 63 BAD BLOCKS
ERROR,	JMS TYPE	/SEVERE ERROR ENTRY POINT
	TAD (ERRMSG)	/"CANNOT FORMAT DISK"
	JMS TYPE
	JMP RE		/RESTART ("DRIVE?")
BADCNT,	0
/TERMINAL SUPPORT SUBROUTINES

/FUNCTIONS:
/TYPE	TYPE A STRING WHOSE ADDR IS IN AC (UNDERLINE
/	MEANS CRLF, 00 TERMINATES).
/GETKEY	WAIT FOR A KEY, GET AND ECHO THE 7-BIT ASCII VALUE.
/PRINT	PRINT ASCII CHAR.
/PRINTN	PRINT OCTAL CONTENTS OF AC.
/CRLF	PRINT RETURN/LINE FEED COMBINATION.
/PRINTB	PRINT A BLANK CHAR.

/INTERESTING LOCATIONS:
/TEMP	TEMP STORAGE
/KEY	LAST KEY TYPED

TYPE,	0
	DCA TEMP
	CLL
TY1,	TAD I TEMP
	SNL
	BSW
	AND (77)
	SNA
	JMP I TYPE
	TAD (-37)	/TEST FOR UNDERLINE CHAR
	SZA
	JMP TY2
	JMS CRLF
	JMP TY3
TY2,	TAD (277)
	AND (277)
	TAD (240)
	JMS PRINT
TY3,	SNL CLA
	ISZ TEMP
	JMP TY1

GETKEY,	0
	KSF
	JMP .-1
	JMS LOOK
	JMS PRINT
	TAD KEY
	JMP I GETKEY

LOOK,	0
	KRB
	AND (177)
	DCA KEY
	TAD KEY
	TAD (-3)
	SNA CLA
	JMP I (7605)
	TAD KEY
	JMP I LOOK

PRINTN,	0
	DCA 0
	TAD (-4)
	DCA TEMP
PR1,	TAD 0
	RTL; RAL
	DCA 0
	TAD 0
	RAL
	AND (7)
	TAD (260)
	JMS PRINT
	ISZ TEMP
	JMP PR1
	JMP I PRINTN

PRINT,	0
	TLS
	TSF
	JMP .-1
	CLA
	KSF
	JMP I PRINT
	JMS LOOK
	CLA
	JMP I PRINT

CRLF,	0
	TAD (215)
	JMS PRINT
	TAD (212)
	JMS PRINT
	JMP I CRLF

PRINTB,	0
	TAD (240)
	JMS PRINT
	JMP I PRINTB

/LITERALS
	PAGE
/SUBROUTINE TO TRANSFER DATA TO/FROM RL01 DISK
/NOTE: ONLY ONE TRY IS ATTEMPTED!
RL01,	0
	TAD I RL01	/GET ARGUMENTS: FUNCTION
	DCA FNC
	ISZ RL01
	TAD I RL01	/MA
	DCA MA
	ISZ RL01
	TAD I RL01	/TRACK
	DCA TRACK
	ISZ RL01
	TAD I RL01	/SECTOR
	BSW		/CONVERT TO RL8A FORMAT
	DCA SECTOR
	ISZ RL01
	TAD TRACK	/CALCULATE CYLINDER AND
	CLL RAR		/SURFACE FROM TRACK
	DCA CYL
	RTR
	DCA SURF
	JMS TRKCMP	/COMPARE WITH CURRENT
			/TRACK; IF SAME, DO THE
			/TRANSFER
RETRY,	RLDC		/IF DIFFERENT, SEEK TO
			/REQUESTED TRACK
			/CLEAR CONTROLLER, AC
SEEK,	IAC		/SEEK WHEN CALLED FROM
			/BELOW, ELSE RESET DRIVE
			/REGISTERS (AC=1 TO RESET,
			/AC=3 TO SEEK)
	JMS IO		/RESET DRIVE OR SEEK
	JMP RETRY	/ERROR RETURN
	TAD (BYTE RLRH)	/NORMAL RETURN:
			/READ NEXT HEADER TO FIND
			/CURRENT TRACK
	JMS IO
	JMP RETRY	/ERROR RETURN
	RRSI		/NORMAL RETURN:
			/GET HEADER BYTE #1
	BSW
	AND (3)
	DCA CURTRK	/SAVE 2 LSB
	RRSI		/GET HEADER BYTE #2
	AND (377)	/HARDWARE SHOULD DO THIS
	CLL RTL
	TAD CURTRK	/ADD IN MSB
	DCA CURTRK
	JMS TRKCMP	/COMPARE WITH CURRENT
			/TRACK; IF SAME, DO THE
			/TRANSFER
	TAD CURTRK	/OFF TRACK: SEEK TO TRACK.
	CLL RAR		/CONSTRUCT DIFFERENCE WORD FOR SEEK.
	CIA
	TAD CYL
	SMA
	JMP AROUND
	CIA
	SKP
AROUND,	TAD (4000)	/SET DIRECTION BIT IF TO HIGHER
			/CYLINDER ADDRESS.
	TAD SURF	/ADD SURFACE BIT
	RLCA		/LOAD DIFFERENCE WORD
	AC0002		/PREPARE FOR SEEK
	JMP SEEK	/LOOP BACK AND SEEK; THIS
			/ENSURES THAT THE TRACK REACHED
			/IS THE CORRECT ONE IN SPITE
			/OF POSSIBLE RL01 SEEK
			/UNRELIABILITY
/SUBROUTINE TO COMPARE REQUESTED TRACK WITH CURRENT
/(REMEMBERED) TRACK; IF SAME, DO TRANSFER.  IF DIFFERENT,
/RETURN WITH AC=REQUESTED-CURRENT, LINK=1
TRKCMP,	0
	TAD CURTRK
	CIA
	TAD TRACK
	SZA CLA
	JMP I TRKCMP	/DIFFERENT; RETURN
	TAD SECTOR	/SAME: DO TRANSFER
			/LOAD ALL REGISTERS
	RLSA
	TAD FNC		/WC IS DOUBLED FOR BYTE MODE
	AND (BYTE)
	SZA CLA
	TAD (-200)	/2 PAGES
	TAD (-200)	/1 PAGE
	RLWC
	TAD SURF	/HARDWARE SHOULD DO THIS
	TAD CYL
	RLCA
	TAD MA
	RLMA
	TAD FNC
	JMS IO		/READ OR WRITE ONE SECTOR
	JMP I RL01	/ERROR: TAKE ERROR RETURN
	ISZ RL01	/TAKE NORMAL EXIT
	JMP I RL01
/SUBROUTINE TO DO RL01 I/O
IO,	0
	TAD DRIVE
	RLCB		/DO I/O OPERATION
WAIT,	CLA		/IN CASE NO RL01 PRESENT
	KSF		/WAIT UNTIL DONE
			/RETURN TO MONITOR IF
			/USER TYPES CTRL,C
	JMP WAIT2
	TAD (7600)
	KRS
	TAD (-7603)
	SNA CLA
	JMP I (MON)
WAIT2,	RLSD
	JMP WAIT
	RLSE
	ISZ IO		/NORMAL RETURN
	JMP I IO	/ERROR RETURN
/DATA
TRACK,	0		/REQUESTED TRACK
CURTRK,	2000		/CURRENT TRACK (INITIALLY
			/ILLEGAL TO FORCE HEADER
			/READ AND SEEK IF NECESSARY)
SECTOR,	0
CYL,	0
SURF,	0
FNC,	0
MA,	0

	PAGE
/TEXT STRINGS

IDMSG,	TEXT "RLFRMT V??_"
	*.-2
	VERSION+60^100+PATCH
	*.+2
MSG,	TEXT "_DRIVE ? "
BDMSG,	TEXT "_PLEASE SPECIFY DRIVE NUMBER (0-3) ON WHICH_"
	*.-1
	TEXT "PACK TO BE FORMATTED IS MOUNTED._"
FAMSG,	TEXT "_FATAL I/O ERROR"
SERMSG,	TEXT " DISK PACK SERIAL NUMBER "
TOOMSG,	TEXT "_OVER 63 NEWLY-FOUND BAD BLOCKS"
ERRMSG,	TEXT "_CANNOT FORMAT DISK_"
ADDMSG,	TEXT "_WARNING: AN ADDITIONAL BAD BLOCK FOUND."
	*.-1
	TEXT "_ZERO DISK BEFORE USE!_"
OVFMSG,	TEXT "_OVER 15 BAD BLOCKS ON ONE DEVICE"
ZERMSG,	TEXT "_WARNING: BAD BLOCK IN SYSTEM AREA._DO NOT USE AS SYSTEM DISK!_"
UNFMSG,	TEXT "_UNFORMATTED (NEW)"
FRMMSG,	TEXT "_OS/8 (OLD)"
BDFMSG,	TEXT " DISK._WARNING: ALL FACTORY-WRITTEN LISTS DESTROYED._"
FACMSG,	TEXT "_FACTORY-DETECTED"
OLDMSG,	TEXT "_PREVIOUS OS/8"
NEWMSG,	TEXT "_NEWLY-FOUND"
FINMSG,	TEXT "_NEW OS/8"
BBMSG,	TEXT " BAD BLOCKS: "
NNMSG,	TEXT "NONE"
FMTMSG,	TEXT "_FORMAT PACK WITH THIS NEW LIST? "
DNMSG,	TEXT "_DONE_"
WRMSG,	TEXT "_PLEASE WRITE-ENABLE DRIVE, THEN HIT 'RETURN'._"

/OTHER DATA
BBCTL,	AANDB		/OS/8 BAD BLOCK CONTROL LIST
			/LIST ADDRESS
	0		/DEVICE CODE
	AANDB+20	/LIST ADDRESS
	1		/DEVICE CODE
	C		/LIST ADDRESS
	2		/DEVICE CODE
	0		/TERMINATOR

FACCTL,	FACTRY+3	/CONTROL LIST TO CHECK VALIDITY
			/OF FACTORY-WRITTEN BBLS.
			/POINTER BEFORE 4 BYTES TO TEST.
	0		/VALUE TO TEST FOR.
	FACTRY+373	/POINTER.
	377		/VALUE.
	0		/TERMINATOR.

$
