perm filename SBST11.PAL[KL,SYS]10 blob sn#565722 filedate 1981-02-19 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00009 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	.SBTTL	*STORE* PROGRAM STORAGE FILE, 5-AUG-75
C00004 00003	BUFFER CREATION MACROS
C00005 00004	PROGRAM BUFFERS & STORAGE AREA
C00012 00005	COMMON STORAGE
C00017 00006	DECTAPE PARAMETER STORAGE
C00020 00007	TELETYPE BUFFERS
C00023 00008	CONSOLE PARAMETER STORAGE
C00025 00009	MISCELLANEOUS STORAGE
C00028 ENDMK
C⊗;
.SBTTL	*STORE* PROGRAM STORAGE FILE, 5-AUG-75

.MACRO	INFORM	A,B
.IF P2
.PRINT	\A=B
\
.ENDC
.ENDM


.IF	DF KLDCP
;DECISION TABLES FOR KL10/11 SUBROUTINE PACKAGE

$DTBL0:
$LF:	.BYTE	12
$CR:	.BYTE	15
$BELL:	.BYTE	07
	.BYTE	00
.EVEN

$DTBL1:	$LFTBL			;LINE FEED FILL TABLE
	$CRTBL			;CARRIAGE RETURN FILL TABLE
	$BELLT			;BELL FILL TABLE

$LFTBL:	.BYTE	1,1
	.BYTE	2,1
	.BYTE	2,4

$CRTBL:	.BYTE	0,0
	.BYTE	9.,1
	.BYTE	2,4

$BELLT:	.BYTE	2,2
	.BYTE	2,2
	.BYTE	2,2

$DTBL:	10000.
	1000.
	100.
	10.
	1.
$TBLL:	1.
	10.
	100.
	1000.
	10000.

.ENDC	;IF DF KLDCP

INFORM	PROGRAM END,\.

;THIS SECTION CONTAINS ALL PROGRAM TEXT LITERALS

$$FF:	$$CLIT

$$LITT=.
$$$FF=$$CLIT

INFORM LITERAL END,\$$CLIT

.IF P2
.=$$CLIT
;PATCH:	.BLKW 40
PATEND==.
.ENDC
;BUFFER CREATION MACROS

$$BUF==	COREND-420		;ROOM FOR STACK
$$STKM==$$BUF			;Bottom boundary of stack

;WORD BUFFER ASSIGNMENT MACRO
.MACRO	.BUFW	$BTAG,$BARG
	.IIF	NE $$BUF&1,$$BUF==$$BUF-1
	.IIF	B $BARG,$$BARG==1
	.IIF	NB $BARG,$$BARG==$BARG
	$$BUF==$$BUF-<$$BARG*2>
	.NLIST
	.LIST	ME	
	.LIST
$BTAG==	$$BUF
	.NLIST	ME
.ENDM

;BYTE BUFFER ASSIGNMENT MACRO
.MACRO	.BUFB	$BTAG,$BARG
	.IIF	B $BARG,$$BARG==1
	.IIF	NB $BARG,$$BARG==$BARG
	$$BUF==$$BUF-$$BARG
	.NLIST
	.LIST	ME
	.LIST
$BTAG==	$$BUF
	.NLIST	ME
.ENDM

	.NLIST	LOC
;PROGRAM BUFFERS & STORAGE AREA
;CLEARED ON INITIALIZATION

;STORAGE FOR DTE20 ADDRESS POINTERS

	.BUFW	.DIAG3		;XXX36
	.BUFW	.STDTE		;XXX34
	.BUFW	.DIAG2		;XXX32
	.BUFW	.DIAG1		;XXX30
	.BUFW	.T11DT		;XXX26
	.BUFW	.T10DT		;XXX24
	.BUFW	.T11AD		;XXX22
	.BUFW	.T10AD		;XXX20
	.BUFW	.BC11		;XXX16
	.BUFW	.BC10		;XXX14
	.BUFW	.TENA2		;XXX12
	.BUFW	.TENA1		;XXX10
	.BUFW	.DAT1		;XXX06
	.BUFW	.DAT2		;XXX04
	.BUFW	.DAT3		;XXX02
	.BUFW	.DELAY		;XXX00


;SPECIAL LOAD ONLY CLEAR & SETUP AREA (HERE TO $ILDCLR IS ZEROED AT LOAD TIME)

	.BUFW	$ONETM		;ONE TIME FLAG
	.BUFW	$ILDSUM		;"KLDCP" CHECKSUM
	.BUFW	$PWRCNT		;POWER RESTART COUNT
	.BUFW	DEVTYP		;DEVICE TYPE: -1=ACT, 0=DTA, 1=RP04
	.BUFW	FLOPPY		;-1, USE RX11/RX01 FLOPPY
	.BUFW	LPTFLG		;LINE PRINTER FLAG
	.BUFW	LPTYPE		;LINE PRINTER TYPE
	.BUFW	RXUNIT		;FLOPPY UNIT
	.BUFW	DTUNIT		;DECTAPE UNIT
	.BUFW	RPUNIT		;RP04 UNIT
	.BUFW	$BKFLG		;BREAKPOINT FLAG
	.BUFW	CLKPE,3		;CLOCK PE DFWRT STORAGE
	.BUFW	PEBITS		;CLOCK STOP PARITY ENABLE BITS
	.BUFW	PAGDFL,3	;KL10 "DATAO PAG,0" DEFAULT
	.BUFW	CLKDFL,3	;KL10 CLOCK DEFAULT
	.BUFW	SWS10,3		;PDP-10 SWITCHES
	.BUFW	$SWS10,3
	.BUFW	$$SWR
	.BUFW	$$STJRS,3	;PDP-10 START "JRST"
	.BUFW	$STODD		;"SETMPH" VARIABLES
	.BUFW	$MPHMK		;MASK, A OR B CHANGE  - used to be byte  --jbr 4/27/76
	.BUFW	$MPHDF		;DIAG FCN, A OR B CHANGE	"
	.BUFW	TGOADR,2	;PDP-10 GO START ADDRESS
	.BUFW	PGOADR,2	;PROGRAM GO ADDRESS
	.BUFW	PGOCTL		;PROGRAM GO CONTROL
	.BUFW	SEADR		;PDP-11 START ADDRESS

.IF DF SAILVR
	.BUFW TIM11,3		;PDP11 TIME COUNTER
	.BUFW	TIMBAS,3	;PDP-10 TIME BASE
	.BUFW	KTIMBS		;NON-ZERO IF TIMEBASE WAS SET FROM 10.
	.BUFW	CLKFLG		;NON-ZERO WHEN THE CLOCK TICKS
	.BUFW	TIMTMP,3	;TEMP CELL FOR TIME BASE EXAMINE-DEPOSIT
	.BUFW	TIMADR,3	;TEMP CELL FOR PDP-10 ADDRESS FOR EXAM, DEPO
.IF DF CLKASB
	.BUFW TIMFLG		;NON-ZERO TO TELL KL10 THE TIME EVERY 10000 TICKS
	.BUFW TMSFLG		;NON-ZERO TO TELL C10COP TO STORE TIME
.ENDC ;DF CLKASB

.IF DF %%QMP
	.BUFW	T11DBF		;NON-ZERO TO TELL CONSOL THAT DOORBELL RANG
	.BUFW	DTEBSY		;NON-ZERO IF DTE IS BUSY WITH TO10 TRANSFER
	.BUFW	DTEBCT		;this is the count of times we saw DTE busy
	.BUFW	EN0PKO		;COUNT OF OUTPUT PACKETS SENT
	.BUFW	EN0ER1		;COUNT OF OUTPUT PACKETS SENT WITH ERROR
	.BUFW	EN0PER		;COUNT OF PERMANENT ERRORS ON OUTPUT PACKETS
	.BUFW	EN0PKI		;COUNT OF INPUT PACKETS RECEIVED ERROR FREE
	.BUFW	EN0ER2		;COUNT OF INPUT PACKETS RECEIVED WITH ERRORS
	.BUFW	EN0MEM		;REJECTED PACKETS, NO BUFFER AVAILABLE
	.BUFW	EN0TRY		;RETRY COUNT FOR PACKET OUTPUT
	.BUFW	EN0BUF		;ADDRESS OF ETHERNET INPUT BUFFER
	.BUFW	ENBCCF		;broadcast pack control flag(s)
	.BUFW	COUN10,3	;FIRST WORD OF 3 FOR DEPOSIT IN 10 MEMORY
	.BUFW	EN0DLY,10	;DELAY TABLE FOR ETHERNET DELAYS
	.BUFW	TO10Q,2		;TWO WORD QUEUE HEAD FOR TO10 QUEUE
	.BUFW	ENETQ,2		;TWO WORD QUEUE HEAD FOR ETHERNET QUEUE
	.BUFW	FR10Q,2		;TWO WORD QUEUE HEAD FOR FR10 QUEUE
;	.BUFW	FREEAD		;ADDRESS OF BEGINNING OF FREE MEMORY
;	.BUFW	FREESZ		;SIZE OF FREE MEMORY (4K WORDS TEMPORARILY)
	.BUFW	FREEQ,2		;ADDRESS OF FIRST POSSIBLE FREE BLOCK
	.BUFW	QMPRQS		;Saved request size for to11 xfer
	.BUFW	ENIHAD		;Saved copy of "real" e/n host address
.ENDC ;DF %%QMP
.ENDC

;DSKDMP BOOT STORAGE
.IF DF BOOASB
	.BUFW BOOTBF,BOOTSZ
	.BUFW BOOTSA,2
	.BUFW BOOTBG,2
.ENDC


.IF NDF TELASB
;KLINIK FIELD SERVICE REMOTE FLAG

	.BUFW DL11EFLG
.IFF
	.BUFW FSSTATE,1		;STATE OF FS TELETYE LINE
	.BUFW FSTPTR,1		;POINTER TO TEXT AT FSTYP
	.BUFW FSTYPR,1		;SAVED RETURN ADDRESS FROM FSTYP
	.BUFB FSRBUF,FSRLEN	;INPUT BUFFER
	.BUFW FSRPTR,1		;POINTER TO FSRBUF
	.BUFW FSFLG,1		;SET FLAG TO INDICATE USE OF FS DL11E
	.BUFW FSCLKA,1		;FS CLOCK REQUEST ADDRESS
	.BUFW FSRTIM,3		;TIME WHEN FS CLOCK REQUEST SHOULD BE DONE
.ENDC

;BP TABLE; INST, ADR, CNT

.IF DF BPTASB
	.BUFW	$BT,<$NB*3>	;BP TABLE
	.BUFW	$BCA		;BP CONTINUE ADDRESS
	.BUFW	$BTIS		;BP TEMP
.ENDC

$ILDCLR=$$BUF
;COMMON STORAGE

	.BUFW	$SWMON		;MONITOR LOW ORDER SWITCHES
	.BUFW	MONCTL		;0=STANDALONE, -1=MONITOR
	.BUFW	TENSWD		;PDP-10 SWITCH DEPOSIT FLAG
	.BUFW	TENCLK		;PDP-10 CLOCK FLAG
	.BUFW	PCMDFLG		;PROGRAM COMMAND FLAG
	.BUFW	PCMDNF		;PROGRAM CMD NO PRINT FLAG
	.BUFW	$ITERA		;ITERATION REGISTER
	.BUFW	$ENDCT		;END OF PASS REPORT COUNT
	.BUFW	$EOPCT		;END OF PASS COUNT
	.BUFW	$ERRPC		;ERROR PC
	.BUFW	$ERTTL		;TOTAL ERRORS DETECTED
	.BUFW	$ERFLG		;ERROR FLAG
	.BUFW	$PASS		;PASS COUNT
	.BUFW	$CMTAG		;COMMON TAG

;DECTAPE/RP04 AND LOADING BUFFERS

	.BUFW	DVBUF,256.	;DEVICE BUFFER
VFUDAT=DVBUF

	.BUFW	EXTBF,2		;ASCII EXTENSION BUFFER
	.BUFW	NAMBF,3		;ASCII NAME BUFFER
	.BUFW	DIRST4
	.BUFW	DIRST3
	.BUFW	DIRST2
	.BUFW	DIRST1
	.BUFW	DIRST0		;PSEUDO DIRECTORY CONVERSION STORAGE
	.BUFW	DTEXT		;RAD50 EXT
	.BUFW	DTEXTS,3	;UNPACKED EXT (ASCII)

	.BUFW	DTLNGTH		;DECTAPE FILE LENGTH
	.BUFW	DTSTRT		;DECTAPE FILE START BLOCK
	.BUFW	DVADR		;DEVICE DATA ADDRESS POINTER
	.BUFW	DVCNT		;DEVICE BYTE COUNT
	.BUFW	DVDIRF		;DEVICE DIRECTORY FLAG
	.BUFW	CDADR		;CORE DUMP BUFFER POINTER
	.BUFW	DIAFLG		;"DIAMON" OPERATION FLAG
	.BUFW	RPEOF		;END-OF-FILE FLAG
	.BUFW	WRTBAK,3	;RPLKUP & RPWRFL RETURN INFO
	.BUFW	$RPINFO,2	;DVDATA POINTERS
	.BUFW	NAMRAD,3	;RAD50 NAME.EXT

.IF DF RPASB
	.BUFW	RPFDNB		;FILE DIRECTORY LENGTH IN BLOCKS
	.BUFW	RPFDTS		;FILE DIRECTORY TRACK & SECTOR
	.BUFW	RPFDCY		;FILE DIRECTORY CYLINDER NUMBER
	.BUFW	RPIXNB		;INDEX FILE LENGTH IN BLOCKS
	.BUFW	RPIXTS		;INDEX FILE TRACK & SECTOR
	.BUFW	RPIXCY		;INDEX FILE CYLINDER NUMBER
	.BUFW	RPIXCB		;INDEX FILE CURRENT BLOCK
	.BUFW	RPLAST		;INDEX FILE LAST BLOCK

	.BUFW	CYLNDR		;CURRENT CYLINDER
	.BUFW	TRKSCT		;CURRENT TRACK & SECTOR
	.BUFW	OFFSET		;CURRENT OFFSET

	.BUFW	BUFADR		;BUFFER ADDRESS
	.BUFW	BUFSIZ		;BUFFER SIZE
	.BUFW	WRDCNT		;READ/WRITE WORD COUNT

	.BUFW	FILDSB,FDESIZ+2	;FILE DESCRIPTOR
.ENDC
;DECTAPE PARAMETER STORAGE

	.BUFW	REVCNT		;REVERSE COUNT
	.BUFW	INTSW		;INIT SWITCH
	.BUFW	$CKS11		;PDP-11 BINARY CHECKSUM
	.BUFW	LTMP		;LOAD TEMP
	.BUFW	LBC		;LOAD BYTE COUNT
	.BUFW	TRYCTR		;DECTAPE TRY COUNT
	.BUFW	DTXCMD		;DECTAPE XFER COMAND
	.BUFW	WCSAV		;WORD COUNT SAVE
	.BUFW	CASAV		;CURRENT ADDRESS SAVE
	.BUFW	DTBLK		;DECTAPE BLOCK NUMBER

;FLOPPY PARAMETER STORAGE
.IF DF RXASB
	.BUFW	$$ITS1		;FLOPPY "$RXITS" COUNTER
	.BUFW	RXSADR		;FLOPPY SECTOR ADDRESS
	.BUFW	RXTADR		;FLOPPY TRACK ADDRESS
	.BUFW	RXBLKT		;FLOPPY BLOCK # TEMP
	.BUFW	RXWCMD		;FLOPPY WORKING COMMAND
	.BUFW	RXCMD		;FLOPPY COMMAND
	.BUFW	RXBLK		;FLOPPY BLOCK NUMBER
.ENDC

;LOAD PARAMETER STORAGE

	.BUFW	LDATAE
	.BUFW	LDATA,34.	;LOAD DATA
	.BUFW	LDADR		;LOAD ADDRESS
	.BUFW	LDCNT		;LOAD WORD COUNT
	.BUFW	LDOCTF		;LOAD OCTAL FORMAT FLAG
	.BUFW	LDCNTL		;LOAD CONTROL WORD
	.BUFW	LDOVRD		;LOAD CONTROL OVERRIDE
	.BUFW	LDZBLK		;LOAD 10 ZERO BLOCK FLAG
	.BUFW	SRTFLG		;SELF START FLAG
	.BUFW	DEVLC		;DEVICE LINE COUNT
.LIF DF MONASB
	.BUFW	ARETRY		;ACT10 RETRY COUNT
	.BUFW	HLPPNT		;ACT10 HELP PRINT FLAG
;TELETYPE BUFFERS

	.BUFW	$INPTR		;INPUT POINTERS
	.BUFW	$INPTC
	.BUFB	$INBUF,142.	;INPUT BUFFER
	.BUFW	$OUTPC		;OUTPUT POINTERS
	.BUFW	$OUTPT
	.BUFW	$OUTPP		;OUTPUT PRINT POSITION
	.BUFB	$OUTBF,142.	;OUTPUT BUFFER

	.BUFW	$TNPTR		;10 INPUT POINTERS
	.BUFW	$TNPTC
	.BUFB	$TNBUF,142.	;10 INPUT BUFFER
	.BUFW	$TNCHR,3	;LAST CHAR TYPED (FOR TEN)
	.BUFW	TENTTY		;10 "TENCHR" FLAG

	.BUFW	$TTYIN
	.BUFB	$TTSAV,12.

.IF DF MONASB
	.BUFW	ENQFLG		;COMMUNICATIONS IN PROGRESS
	.BUFW	MSGNBR		;COMMUNICATIONS MESSAGE NUMBER
	.BUFW	COMNBR		;COMMUNICATION NUMBER
	.BUFB	COUTBF,142.	;COMMUNICATIONS OUTPUT BUFFER
	.BUFW	COUTSP,2	;OUTPUT CONTROL CHARACTERS
	.BUFB	CINBF,142.	;COMMUNICATIONS INPUT BUFFER
	.BUFW	CINSP,2		;INPUT CONTROL CHARACTERS
.ENDC
	.BUFW	$PRNTH		;PRINT HEAD POSITION
	.BUFW	$PGWID		;PAGE WIDTH
	.BUFW	$TPLIN		;NUMBER OF LINES ON A PAGE
	.BUFW	$TPLIT		;LINES TALLY
	.BUFW	$XOFLG		;XOFF FLAG, -1 = NO PRINT
	.BUFW	CTRLOF		;CONTROL O FLAG
	.BUFW	$EOLFLG		;END OF LINE FLAG
	.BUFW	$TTLKF		;TTLOOK INPUT CHECKS INHIBIT
	.BUFW	TILNWF		;TTY INPUT WAIT FLAG
	.BUFW	$FORCE		;FORCE PRINTOUT FLAG
	.BUFW	$TTYFL		;TTY FILL PARAMETER
	.BUFW	$0FLG		;ZERO FILL FLAG
	.BUFW	$NEG		;NEGATE NUMBER INPUT FLAG
	.BUFW	$SVH
	.BUFW	$SVM

	.BUFW	$TICHR		;TTY DRIVER INPUT CHAR
	.BUFW	$TOCHR		;TTY DRIVER OUTPUT CHAR

	.BUFW	DDTFLG		;PDP-10 DDT INPUT MODE FLAG
;CONSOLE PARAMETER STORAGE

	.BUFW	$KONSP		;SAVED STACK POINTER
	.BUFW	ALLFLG		;ALL PRINT FLAG
	.BUFW	RPTFLG		;COMMAND REPEAT FLAG
	.BUFW	VERIFY		;PROGRAM VERIFY FLAG
	.BUFW	.EADR		;EXAMINE 11 ADDRESS
	.BUFW	$ECADR		;EXAMINE C-RAM ADDRESS
	.BUFW	$EDADR		;EXAMINE D-RAM ADDRESS
	.BUFW	$ADR
	.BUFW	$ADR1
	.BUFW	.DFRDA,3
	.BUFW	.DPXAD,2

	.BUFW	L10ADR,2	;LOAD 10 ADDRESS
	.BUFW	$TEMP0,3

	.BUFW	TENRUN		;TEN RUNNING FLAG
	.BUFW	MONMODE		;TEN MONITOR MODE FLAG
	.BUFW	MTTYOF		;MONITOR TTY OUTPUT IN PROGRESS
	.BUFW	$TTYTIM		;TTY TIMEOUT COUNT
	.BUFW KASIM		;KASIM TURNED ON

	.BUFW	$PCSAV
	.BUFW	$PSSAV
	.BUFW	$SPSAV
	.BUFW	$R5SAV
	.BUFW	$R4SAV
	.BUFW	$R3SAV
	.BUFW	$R2SAV
	.BUFW	$R1SAV
	.BUFW	$R0SAV
;MISCELLANEOUS STORAGE

	.BUFW	$EMADR		;EMT ADDRESS (+2)

	.BUFW	$SWTCH		;SWITCHES
	.BUFW	$$SVSP
	.BUFW	TEMP
	.BUFW	IFILEF		;INDIRECT FILE FLAG
	.BUFW	IFINP		;INDIRECT STORAGE POINTER
	.BUFW	JFILEF		;DOUBLE INDIRECT FILE FLAG
	.BUFW	JFINP		;DOUBLE INDIRECT STORAGE POINTER

	.BUFW	PRGRUN		;PROGRAM RUNNING FLAG

	.BUFW	MEMPEF		;PARITY FLAG

	.BUFW	.HCFLG		;ALLOW HALT CONTINUE FLAG
	.BUFW	.HCADR		;HALT CONTINUE ADDRESS

	.BUFW	DDTTM1		;DDT MODE TIMEOUT COUNTS
	.BUFW	DDTTM2

	.BUFW	$ECMD,3		;DTE20 COMMAND STORAGE
	.BUFW	$SAV20,3	;PDP-10 SAVE 20 STORAGE
	.BUFW VRBFLG		;VERBOSE TYPEOUT OF EXAMINE/DEPOSIT ERRORS FLAG



;KL10 SUBROUTINE STORAGE

	.BUFW	ZEROS,3		;SOURCE OF 36 ZEROS
	.BUFW	VMADAT,3	;VMA & PC TEMP
	.BUFW	XXDAT		;DF WRITE TEMP
	.BUFW	MMDAT,3		;WWADR TEMP
	.BUFW	WREADY,3	;$WCRAM TEMP
	.BUFW	SIGNL
	.BUFW	$BUFRC,6	;$RCRAM TEMP
	.BUFW	SIGNL2
	.BUFW	SIGNL3
	.BUFW	DDRAM,3		;$DRAMAD TEMP
	.BUFW	RDRTMP,2	;$RDRAM TEMP
	.BUFW	$DRAM,6
	.BUFW	$DDRMS
	.BUFW	$STDAT		;$BURST TEMP
	.BUFW	KLCLKR		;KL10 CLOCK LOGICALLY RUNNING FLAG
	.BUFW	TENDAT,3	;PDP-10 INPUT DATA WORD
	.BUFW	TENAC0,2	;PDP-10 AC0 ADDRESS
	.BUFW	C10CW,3		;PDP-10 CLOCK WAIT COUNT
	.BUFW	CLKCNT,3	;PDP-10 CLOCK COUNT
.IF DF FSCASB
	.BUFW	BFREE		;NUMBER OF BLOCKS OF FREE STORAGE CURRENTLY FREE
	.BUFW	WUSED		;NUMBER OF WORDS OF FREE STORAGE IN USE
	.BUFW	NGETS		;NUMBER OF CALLS ON $RLCB
	.BUFW	NGIVES		;NUMBER OF SUCCESSFUL CALLS ON $RQCB
.ENDC; DF FSCASB

.IIF DF EPTREL,	.BUFW	$TADSP	;TEN ADDRESS SPACE FOR EXAMINES AND DEPOSITS
.IIF DF SAILVR,	.BUFW	SWTDEP	;SET TO -1 IF 11 SHOULD DEPOSIT IN $DTSWR

	.LIST	LOC
BUFCLR==$$BUF

.IF2
.IFL $$BUF-PATEND
.PRINT \BUFFER STORAGE OVERLAPS LITERAL STORAGE, FLUSH SOMETHING!
\
INFORM OVERLAP,\PATEND-$$BUF
.IFF
INFORM FREE LITERAL/BUFFER SPACE,\$$BUF-PATEND
.ENDC
.ENDC