	.TITLE	FNEW
/
/FOCAL EXTERNAL FUNCTION PROGRAM
/
/COPYRIGHT 1969
/DIGITAL EQUIPMENT CORP.
/MAYNARD, MASS.
/
/DAVE LENEY
/2-7-69
/
	.GLOBL	.NEWF		/FUNCTION TABLE
	.GLOBL	XPUSHJ		/PUSH JUMP
	.GLOBL	XPUSHA		/PUSH AC
	.GLOBL	PD2		/PUSH FP
	.GLOBL	PD3		/POP FP
	.GLOBL	UTRA		/GET CHAR
	.GLOBL	XSPNOR		/SKIP SPACE & ZEROS
	.GLOBL	FUNERR		/FUNCTION ERROR
	.GLOBL	EFUN3		/FUNCTION RETURN
	.GLOBL	FINT		/FLOATING ARITH
	.GLOBL	CHAR		/CHAR STORAGE
	.GLOBL	EVAL		/EXPRESSION EVALUATOR
	.GLOBL	.AA		/EXPONENT (2'S COMP)
	.GLOBL	.AB		/SIGN AND HIGH ORDER MANTISSA
	.GLOBL	.AC		/LOW ORDER MANTISSA
	.GLOBL	.BA		/NEGATE
	.GLOBL	.AX		/FIX
	.GLOBL	.AW		/FLOAT
/
/CARNEGIE-MELLON UNIVERSITY
/HYBRID COMPUTATION LABORATORY
/HYBRID FOCAL LIBRARY
/
/CHRISTOPHER L. CROSS
/MARCH, 1969
/
	.GLOBL INIT
	.GLOBL RSAC
	.GLOBL RBAC
	.GLOBL SAMO
	.GLOBL STCO
	.GLOBL SLMO
	.GLOBL RAMO
	.GLOBL RTCO
	.GLOBL RLMO
	.GLOBL SSRP
	.GLOBL SSRM
	.GLOBL SBRP
	.GLOBL SBRM
	.GLOBL RSCS
	.GLOBL RBCS
	.GLOBL RAVA
	.GLOBL SPOT
	.GLOBL CRAC
	.GLOBL LSDA
	.GLOBL LTDA
	.GLOBL LBDA
	.GLOBL TLDA
	.GLOBL SSCL
	.GLOBL RSCL
	.GLOBL SBCL
	.GLOBL RBCL
	.GLOBL LBCL
	.GLOBL TRSL
	.GLOBL TRST
	.GLOBL RSSL
	.GLOBL RBSL
	.GLOBL CWSL
	.GLOBL CLVL
	.GLOBL %CLOCK,%START,%STOP,%ENTER,%DLETE
/
/FLOATING POINT PSEUDO-OPS
/
FPOW=000000
FADD=100000
FSUB=200000
FMUL=300000
FDIV=400000
FGET=500000
FPUT=600000
FNOR=700000
FXIT=000000
/
	.EJECT
/
/FOCAL OPERATIONS (FOCAL SOURCE EQUIVALENT IN PARENS)
/
/PUSH JUMP TO EXPRESSION EVALUATOR (PUSHJ EVAL)
/	LAC	EVAL
/	DAC	.+2
/	JMS*	XPUSHJ
/	XX
/
/PUSH THE HARDWARE ACCUMULATOR (PUSHA)
/	JMS*	XPUSHA
/
/POP THE HARDWARE ACCUMULATOR (POPA)
/	LAC*	13
/
/PUSH FLOATING ACCUMULATOR (PUSHF.AA)
/	LAC	.AA
/	DAC	.+2
/	JMS*	PD2
/	XX
/POP FLOATING ACCUMULATOR (POPF .AA)
/	LAC	.AA
/	DAC	.+2
/	JMS*	PD3
/	XX
/
/PUSH FLOATING VARIABLE (PUSHF VAR)
/	JMS*	PD2
/	.DSA	VAR		/WHERE VAR IS THE FIRST OF
/				/THREE(3) REGISTER BLOCK
/
/POP FLOATING VARIABE (POPF VAR)
/	JMS*	PD3
/	.DSA	VAR		/SAME AS FOR PUSHF VAR
/
/FETCH CURRENT CHARACTER
/	LAC*	CHAR
/
/FETCH NEXT CHARACTER (GETC)
/	JMS*	UTRA		/CHARACTER IN BOTH CHAR AND AC
/
/IGNORE LEADING SPACES AND ZEROS (SPNOR)
/	JMS*	XSPNOR		/NEXT CHARACTER IN BOTH CHAR AND AC
/
/INDICATE A FUNCTION ERROR (ERROR NN)
/	.DEC
/	LAW	NN		/NN=TWO DIGIT (DECIMAL) ERROR CODE
/	.OCT
/	JMP*	FUNERR		/ERROR WILL HAVE DOUBLE QUESTION MARK
/
/RETURN FROM FUNCTION (RETURN)
/	JMP*	EFUN3		/VALUE OF FUNCTION IN FLOATING AC
/
/ENTER FLOATING POINT INTERPRETER (JMS FINT)
/	JMS*	FINT		/FROM HERE ON ALL INSTRUCTIONS
/	FNN	A		/ARE ASSUMED TO BE FLOATING POINT
/	FNN*	B		/UNTIL FXIT IS REACHED - FNN
/	FNN	C		/REFERS TO FLOATING POINT OPERATIONS
/	FXIT			/LISTED NEXT.
/
/FLOATING POINT OPERATIONS (USE * FOR INDIRECT)
/	FPOW	VAR		/RAISE F.P. AC TO VAR/CONSTANT
/	FADD	VAR		/ADD F.P. VARIABLE/CONSTANT TO F.P. AC
/	FSUB	VAR		/SUBTRACT FROM F.P. AC
/	FMUL	VAR		/MULTIPLY THE F.P. AC
/	FDIV	VAR		/DIVIDE INTO THE F.P. AC
/	FGET	VAR		/LOAD INTO THE F.P. AC
/	FPUT	VAR		/STORE THE F.P. AC
/	FNOR			/NORMALIZE THE F.P. AC
/	FXIT			/EXIT FROM FLOATING POINT MODE
/
/NEGATE THE FLOATING ACCUMULATOR
/	JMS*	.BA
/
/FIX THE FLOATING ACCUMULATOR INTO THE HARDWARE ACCUMULATOR
/	JMS*	.AX
/
/FLOAT THE HARDWARE ACCUMULATOR INTO THE FLOATING ACCUMULATOR
/	JMS*	.AW
/
/
/EXTERNAL FUNCTION TABLE FORMAT
/	WORD 0: TWO'S COMPLEMENT COUNT OF NUMBER OF ENTRIES
/	WORDS 1 TO 2N: N TWO WORD ENTRIES
/		EACH ENTRY:	WORD0: .SIXBT THREE LETTER FUNCTION NAME
/				WORD1: JMP TO FUNCTION ADDRESS
/
/
	.EJECT
/
/TABLE OF NAMES OF EXTERNAL FUNCTIONS
/
.NEWF	.NEWFE-.-1/2\777777+1	/TWO'S COMP COUNT OF NAMES
	.SIXBT /SAM/
	JMP FSAM	/SET ANALOG MODE
	.SIXBT /STC/
	JMP FSTC	/SET TIME CONSTANT
	.SIXBT /SLM/
	JMP FSLM	/SET LOGIC MODE
	.SIXBT /RAM/
	JMP FRAM	/READ ANALOG MODE
	.SIXBT /RTC/
	JMP FRTC	/READ TIME CONSTANT
	.SIXBT /RLM/
	JMP FRLM	/READ LOGIC MODE
	.SIXBT /SRP/
	JMP FSRP	/SET RELAYS PLUS
	.SIXBT /SRM/
	JMP FSRM	/SET RELAYS MINUS
	.SIXBT /SBR/
	JMP FSBR	/SET BANK OF RELAYS
	.SIXBT /RSC/
	JMP FRSC	/READ SINGLE COMPARATOR STATUS
	.SIXBT /RBC/
	JMP FRBC	/READ BANK OF COMPARATORS STATUS
	.SIXBT /POT/
	JMP FPOT	/SET A POTENTIOMETER
	.SIXBT /RAV/
	JMP FRAV	/READ ANALOG VALUE
	.SIXBT /DAC/
	JMP FDAC	/LOAD DAC'S
	.SIXBT /BDA/
	JMP FBDA	/LOAD BANK OF DAC'S
	.SIXBT /TDA/
	JMP FTDA	/TRANSFER LOADED DAC'S
	.SIXBT /JAM/
	JMP FJAM	/SET OR RESET JAM MODE
	.SIXBT /ADC/
	JMP FADC	/READ ADC CHANNEL
	.SIXBT /SCL/
	JMP FSCL	/SET CONTROL LINES
	.SIXBT /RCL/
	JMP FRCL	/RESET CONTROL LINES
	.SIXBT /BCL/
	JMP FBCL	/SET, RESET, OR LOAD BANK OF CONTROL LINES
	.SIXBT /RSL/
	JMP FRSL	/READ SINGLE SENSE LINE
	.SIXBT /TSL/
	JMP FTSL	/TEST AND RESET SINGLE SENSE LINE
	.SIXBT /LSL/
	JMP FLSL	/TEST FOR A HIGH LEVEL SINGLE SENSE LINE INPUT
	.SIXBT /BSL/
	JMP FBSL	/READ BANK OF SENSE LINES
	.SIXBT /CSL/
	JMP FCSL	/CONTINUE WHEN A SINGLE SENSE LINE IS HIGH
	.SIXBT /LVL/
	JMP FLVL	/CONTINUE WHEN A SINGLE SENSE LINE INPUT IS A HIGH LEVEL
	.SIXBT /SSW/
	JMP FSSW	/READ SINGLE AC SWITCH
	.SIXBT /BSW/
	JMP FBSW	/READ BANK OF AC SWITCHES
	.SIXBT /TIM/
	JMP FTIM	/REAL TIME CLOCK: START, INTERROGATE, OR STOP
	.SIXBT /IDL/
	JMP FIDL	/REAL-TIME VARIABLE-LENGTH IDLE
	.SIXBT	'PRN'
	JMP	RANDOM
	.SIXBT	'DCL'	/DISABLE ALL CLOCK REQUESTS
	JMP	FDCL
.NEWFE=.
	.EJECT
/
/  GENERATE PSEUDO RANDOM NUMBER
/
RANDOM	LAC*	(0
	STL
	RAL
	DAC	NUM
	LAC	(JMP .+2
	DAC	RANDOM
	DZM*	.AA
	LAC	MULT
	MUL
NUM	XX
	DAC*	.AC
	LACQ
	DAC*	.AB
	DAC	NUM
	JMP*	EFUN3
	.DEC
MULT	78125
	.OCT
/
/  FUNCTION TO CLEAR CLOCK QUEUE OF ALL PENDING REQUESTS
/
FDCL	LAW	-4
	DAC	DCLCNT	/THERE ARE 4 SLOTS IN THE QUEUE
	DZM	QUE
DCLNXT	ISZ	QUE
	LAC	QUE
	JMS*	%DLETE	/DELETE EACH QUEUE ENTRY SEPARATELY
	ISZ	DCLCNT
	JMP	DCLNXT
	DZM*	.AA	/ZERO FLOATING ACCUMULATOR SO
	DZM*	.AB	/FUNCTION RETURNS VALUE OF ZERO
	DZM*	.AC
	JMP*	EFUN3
DCLCNT;QUE
/
	.EJECT
/SET ANALOG MODE
FSAM	LAC SAMO
	JMP JUST2
/SET TIME CONSTANT
FSTC	LAC STCO
	JMP JUST2
/SET LOGIC MODE
FSLM	LAC SLMO
	JMP JUST2
/READ ANALOG MODE
FRAM	LAC RAMO
	JMP JUST1I
/READ TIME CONSTANT
FRTC	LAC RTCO
	JMP JUST1I
/READ LOGIC MODE
FRLM	LAC RLMO
	JMP JUST1I
/SET RELAYS PLUS
FSRP	LAC SSRP
	JMP MANY2
/SET RELAYS MINUS
FSRM	LAC SSRM
	JMP MANY2
/SET BANK OF RELAYS
FSBR	JMS* .AX	/LOAD FIRST ARGUMENT
	SMA
	JMP .+3
	LAC SBRM	/MINUS
	SKP
	LAC SBRP	/PLUS
	JMP JUST1O
/READ SINGLE COMPARATOR STATUS
FRSC	LAC RSCS
	JMP JUST1F
/READ BANK OF COMPARATORS STATUS
FRBC	LAC RBCS
	JMP JUST1P
/SET POTENTIOMETERS
FPOT	LAC (JMS UNNORM
	DAC FIX	/CONVERT COEFFICIENTS TO UNNORMALIZED INTEGERS
	LAC SPOT
	JMS PAIR1	/GET FIRST POT AND COEFFICIENT
	LAC (2
	DAC ARG3	/TOLERANCE=2 MILLIVOLTS
	JMS FORARG	/CALL SPOT
	JMS PAIR	/GET NEXT POT AND COEFFICIENT
	JMP .-2	/REPEAT
/READ ANALOG VALUE
FRAV	LAC* CHAR
	SAD (251
	JMP ER11	/NO ARGUMENTS PRESENT
	LAC (NOP
	DAC FIX	/NO ARGUMENT MANIPULATION NECESSARY
	LAC RAVA
	JMS PAIR1	/GET FIRST COMPONENT TYPE AND ADDRESS
	JMS FORARG	/CALL RAVA
	LAC ARG3
	JMS* .AW	/FLOAT UNNORMALIZED COMPONENT VALUE
	JMS* FINT
	FDIV UNITYU	/SCALE IT BETWEEN + AND - 1
	FXIT
	JMP* EFUN3
/LOAD DAC'S
FDAC	LAC (JMS NORM
	DAC FIX	/CONVERT COEFFIECIENTS TO UNNORMALIZED INTEGERS
	LAC JAM
	SMA
	JMP .+3
	LAC LSDA	/JAM OFF
	SKP
	LAC LTDA	/JAM ON
	JMS PAIR1	/GET FIRST CHANNEL AND VALUE
	JMS TRIARG	/CALL LSDA OR LTDA
	JMS PAIR	/GET NEXT CHANNEL AND VALUE
	JMP .-2	/REPEAT
/LOAD BANK OF DAC'S
FBDA	JMS* .AX
	SPA
	JMP ER12	/FIRST CHANNEL<0
	DAC ARG1	/FIRST CHANEL
	DAC ARG2	/CURRENT CHANNEL
	TAD (ARG3
	DAC LOC	/CURRENT VALUE STORAGE POINTER
	JMS GETARG	/GET FIRST VALUE
	JMP OUT0	/NULL VALUE LIST
NEXTCH	JMS NORM	/NORMALIZE IT
	JMS* .AX	/CONVERT IT TO AN INTEGER
	DAC* LOC	/STORE IT AS CURRENT VALUE
	JMS GETARG	/GET NEXT VALUE
	JMP LASTCH	/THERE ISN'T ANY MORE
	LAW 17765
	TAD ARG2
	SMA
	JMP ER12	/CURRENT CHANNEL>10
	ISZ ARG2	/INCREMENT CURRENT CHANNEL
	ISZ LOC	/INCREMENT CURRENT VALUE STORAGE POINTER
	JMP NEXTCH	/REPEAT
LASTCH	LAC LBDA
	DAC HYBRID
	JMS FORARG	/CALL LBDA
	LAC JAM
	SPA
	JMP OUT0	/USER'S RESPOSIBILITY TO TRANSFER
/TRANSFER LOADED DAC'S
FTDA	JMS* TLDA	/CALL TLDA
	JMP OUT0
/SET OR RESET JAM MODE
FJAM	JMS* .AX	/LOAD ARGUMENT
	DAC JAM	/SET/RESET JAME MODE
	JMP OUT0
/READ ADC CHANNEL
FADC	JMS* .AX	/GET CHANNEL
	DAC ARG1
	LAC CRAC
	DAC HYBRID
	JMS TRIARG	/CALL CRAC
	LAC ARG2	/LOAD VALUE
	JMS* .AW	/FLOAT IT
	JMS* FINT
	FDIV UNITYN	/NORMALIZE IT
	FXIT
	JMP* EFUN3
/SET CONTROL LINES
FSCL	LAC SSCL
	JMP MANY2
/RESET CONTROL LINES
FRCL	LAC RSCL
/CALL A TWO-ARGUMENT LINKAGE ROUTINE REPETITIVELY
MANY2	DAC HYBRID
	JMP .+3
	JMS GETARG	/GET NEXT ARGUMENT
	JMP OUT0	/THERE AREN'T ANY -RETURN
	JMS* .AX
	DAC ARG1
	JMS TWOARG	/CALL SSRP OR SSRM OR SSCL OR RSCL
	JMP .-5	/REPEAT
/SET, RESET OR LOAD BANK OF CONTROL LINES
FBCL	JMS* .AX	/LOAD FIRST ARGUMENT
	SNA
	JMP .+7
	SMA
	JMP .+3
	LAC RBCL	/RESET
	JMP .+4
	LAC SBCL	/SET
	SKP
	LAC LBCL	/LOAD
/CALL A ONE-ARGUMENT "PATTERN" LINKAGE OUTPUT ROUTINE
JUST1O	DAC HYBRID
	JMS GETARG	/GET PATTERN ARGUMENT
	JMP ER11	/IT'S MISSING
	JMS* FINT
	FDIV TWO	/DIVIDE BY TWO
	FXIT
	JMS* .AX	/CONVERT IT TO AN INTEGER
	RAL	/SHIFT IT BACK FOR EAI
	DAC ARG1
	JMS ONEARG	/CALL SBRM OR SBRP OR RBCL OR SBCL OR LBCL
	JMP OUT0
/READ SINGLE SENSE LINE
FRSL	LAC RSSL
	JMP JUST1F
/TEST AND RESET SINGLE SENSE LINE
FTSL	LAC TRSL
	JMP JUST1F
/TEST FOR A HIGH LEVEL SINGLE SENSE LINE INPUT
FLSL	LAC TRST
	JMP JUST1F
/READ BANK OF SENSE LINES
FBSL	LAC RBSL
/CALL A ONE ARGUMENT "PATTERN" LINKAGE INPUT ROUTINE
JUST1P	DAC HYBRID
	JMS ONEARG	/CALL RBCS OR RBSL
	LAC ARG1	/GET PATTERN
	CLL!RAR	/SHIFT IT FOR EAI
	JMS* .AW	/FLOAT IT
	JMS* FINT
	FMUL TWO	/SHIFT IT BACK
	FXIT
	JMP* EFUN3
/CONTINUE WHEN A SINGLE SENSE LINE IS HIGH
FCSL	LAC CWSL
	JMP JUST2
/CONTINUE WHEN A SINGLE SENSE LINE INPUT IS A HIGH LEVEL
FLVL	LAC CLVL
/CALL A TWO-ARGUMENT LINKAGE ROUTINE
JUST2	DAC HYBRID
	JMS* .AX
	DAC ARG1	/STORE FIRST ARGUMENT
	JMS TWOARG	/CALL SAMO OR STCO OR SLMO OR CWSL OR CLVL
	JMP OUT0
/READ A SINGLE AC SWITCH
FSSW	LAC RSAC
/CALL A ONE-ARGUMENT LINKAGE FUNCTION
JUST1F	DAC HYBRID
	JMS* .AX
	DAC ARG1	/STORE THE ARGUMENT
	JMS ONEARG	/RSCS OR RSSL OR TRSL OR TRST OR RSAC
	JMS* .AW	/FLOAT THE ANSWER (-1 OR 0)
	JMP* EFUN3
/READ BANK OF AC SWITCHES
FBSW	LAC RBAC
/CALL A ONE-ARGUMENT LINKAGE INPUT ROUTINE
JUST1I	DAC HYBRID
	JMS ONEARG	/CALL RAMO OR RTCO OR RLMO OR RBAC
	LAC ARG1
	JMS* .AW	/FLOAT  THE RESULT
	SMA
	JMP* EFUN3
	JMS* FINT
	FADD UNITY2	/ADD 262144 TO COUNTERACT SIGN BIT
	FXIT
	JMP* EFUN3
/START, INTERROGATE, OR STOP REAL-TIME CLOCK
FTIM	JMS* .AX	/GET THE ARGUMENT
	SMA
	JMP PZTIM	/0 OR +1
	JMS* %START	/-1: START THE CLOCK
	LAC (1
	JMS* %ENTER	/START INTERVAL REQUEST CHAIN
	CLOCK
	DZM CYCLES	/CYCLES=0
	JMP OUT0	/FTIM=0
PZTIM	SZA
	JMS* %STOP	/+1: STOP THE CLOCK
	LAC CYCLES	/0: INTERROGATE THE CLOCK
	JMS* .AW	/FLOAT CYCLES
	JMP* EFUN3	/FTIM=# OF CYCLES
CLOCK	0
	ISZ CYCLES	/INCREMENT CYCLES
	LAC (1
	JMS* %ENTER	/CONTINUE INTERVAL REQUEST CHAIN
	CLOCK
	JMP* CLOCK	/RETURN TO INTERRUPTED PROGRAM SEGMENT
CYCLES
/****************************************************************
/NOTE:  ^P CAN EVENTUALLY OVERFLOW THE CLOCK QUEUE (IOPS 74)
/   THIS MAY BE FIXED AT A LATER DATE BY INTERFACING TO
/   THE ^P ROUTINE IN THE MAIN FOCAL PROGRAM
/****************************************************************
/IDLE FOR AN INDICATED LENGTH OF REAL TIME
FIDL	JMS* .AX	/GET THE INTERVAL LENGTH
	SPA!SNA
	JMP ER13	/ILLEGAL INTERVAL REQUESTED
	DAC LOC
	JMS* %START	/START THE CLOCK
	LAC LOC
	JMS* %ENTER	/REQUEST THE INTERVAL
	IDLE
	DZM IDLE
	CLA
	SAD IDLE
	JMP .-1	/WAIT FOR INTERVAL TO FINISH
			/FIDL=0
OUT0	DZM* .AA	/ZERO FLOATING POINT RESULT
	DZM* .AB
	DZM* .AC
	JMP* EFUN3	/RETURN
IDLE	0
/NOTE:  PUTTING JMS* %STOP HERE WILL CATCH OCCASSIONAL
/       IDLE INTERVALS WHICH ARE INTERRUPTED BY A ^P
/       AND CLEAR THEM FROM THE CLOCK QUEUE WITHOUT
/       INTERFERING WITH ANYTHING ELSE.
	JMS* %STOP	/STOP THE CLOCK
	JMP* IDLE	/INTERVAL IS FINISHED
/END OF FUNCTION LIBRARY CODING
	.EJECT
/GET THE NEXT FUNCTION ARGUMENT
GETARG	0
	JMS* XSPNOR	/SKIP SPACES
	SAD (254	/IS IT A COMMA?
	SKP	/YES
	JMP* GETARG	/NO-NO MORE ARGUMENTS
	ISZ GETARG
	JMS* UTRA	/SKIP THE COMMA
	LAC EVAL
	DAC .+2
	JMS* XPUSHJ	/CALL EXPRESSION EVALUATOR
	XX
	JMP* GETARG	/RETURN WITHE THE NEXT ARGUMENT IN FLOATING AC
/
/GET THE FIRST PAIR OF FUNCTION ARGUMENTS
PAIR1	0
	DAC HYBRID	/STORE THE LINKAGE ROUTINE NAME
	LAC* CHAR
	SAD (251
	JMP OUT0	/NO ARGUMENTS-EXIT FROM FNEW
	JMS SUBPR
	JMP* PAIR1
/
/GET SUCESSIVE PAIRS OF FUNCTION ARGUMENTS
PAIR	0
	JMS GETARG
	JMP OUT0	/NO MORE ARGUMENTS - EXIT FROM FNEW
	JMS SUBPR
	JMP* PAIR
/
/GET A PAIR OF FUNCTION ARGUMENTS
SUBPR	0
	JMS* .AX
	DAC ARG1	/STORE THE FIRST ARGUMENT
	JMS GETARG
	JMP ER11	/SECOND ARGUMENT OF PAIR IS MISSING
	XCT FIX	/MANIPULATE SECOND ARGUMENT
	JMS* .AX
	DAC ARG2	/STORE SECOND ARGUMENT
	JMP* SUBPR
FIX	XX
/
/CONVERT A FUNCTION ARGUMENT TO UNNORMALIZED FORM
UNNORM	0
	JMS* FINT
	FMUL UNITYU	/UNNORMALIZED
	FXIT
	JMP* UNNORM
/
/CONVERT A FUNCTION ARGUMENT TO NORMALIZED FORM
NORM	0
	JMS* FINT
	FMUL UNITYN	/NORMALIZED
	FXIT
	JMP* NORM
UNITYU	000016	/10000 DECIMAL
	234200	/(DOUBLE PRECISION)
	000000
UNITYN	000022	/131072 DECIMAL
	200000	/(DOUBLE PRECISION)
	000000
UNITY2	000023	/262144 DECIMAL
	200000	/(DOUBLE PRECISION)
	000000
	.EJECT
/CALL A ONE-ARGUMENT LINKAGE ROUTINE
ONEARG	0
	XCT CALL
	JMP .+2
	ARG1
	JMP* ONEARG
/
/CALL A TWO-ARGUMENT LINKAGE ROUTINE
TWOARG	0
	XCT CALL
	JMP .+3
	ARG1
	ARG2
	LAC ARG2	/GET IERROR
	SAD (0
	JMP* TWOARG	/NO ERROR
	JMP* FUNERR	/REPORT LINKAGE ROUTINE ERROR
/
/CALL A THREE ARGUMENT LINKAGE ROUTINE
TRIARG	0
	XCT CALL
	JMP .+4
	ARG1
	ARG2
	ARG3
	LAC ARG3	/GET IERROR
	SAD (0
	JMP* TRIARG	/NO ERROR
	JMP* FUNERR	/REPORT THE LINKAGE ROUTINE ERROR
/
/CALL A FOUR-ARGUMENT LINKAGE ROUTINE
FORARG	0
	XCT CALL
	JMP .+5
	ARG1
	ARG2
	ARG3
	ARG4
	LAC ARG4	/GET IERROR
	SAD (0
	JMP* FORARG	/NO ERROR
	JMP* FUNERR	/REPORT LINKAGE ROUTINE ERROR
/
ARG1		/FIRST LINKAGE ROUTINE ARGUMENT
ARG2		/SECOND LINKAGE ROUTINE ARGUMENT
ARG3	.BLOCK 14	/THIRD LINKAGE ROUTINE ARGUMENT
		/.BLOCK IS FOR A BANK OF DAC VALUES
ARG4		/FOURTH LINKAGE ROUTINE ARGUMENT
CALL	JMS START	/ALTERED TO JMS* HYBRID
HYBRID		/LINKAGE ROUTINE ADDRESS STORAGE
	.EJECT
/INITIALIZE THE HYBRID COMPUTER
START	0
	JMS* INIT	/CALL INIT
	JMP .+2
	LOC
	LAC LOC
	SZA
	JMP ER10	/INIT FAILED
	LAC (JMS* HYBRID	/INIT SUCCESSFUL
	DAC CALL	/CALL LINKAGE ROUTINES RATHER THAN INIT
			/FROM NOW ON
	CLC
	TAD START
	DAC START	/DECREMENT (START)
	JMP* START	/REPEAT THE XCT INSTRUCTION
/
/ERROR SECTION
	.DEC
ER10	LAW 10
	JMP* FUNERR	/INIT WAS NOT SUCCESSFUL
ER11	LAW 11
	JMP* FUNERR	/MISSING ARGUMENT
ER12	LAW 12
	JMP* FUNERR	/FBDA REQUESTED A CHANNEL>11
ER13	LAW 13
	JMP* FUNERR	/ILLEGAL REAL-TIME IDLE INTERVAL REQUESTED
	.OCT
/
JAM	1	/STATUS OF JAM MODE
LOC		/POINTER TO CURRENT VALUE FOR FBDA
TWO	000002	/TWO DECIMAL
	200000
	000000
	.END
