Google
 

Trailing-Edge - PDP-10 Archives - AP-4178E-RM - swskit-sources/impbbn.mac
There are no other files named impbbn.mac in the archive.
;<3-MONITOR>IMPBBN.MAC.4,  7-Nov-77 13:02:23, EDIT BY KIRSCHEN
;MORE COPYRIGHT UPDATING...
;<3-MONITOR>IMPBBN.MAC.3, 12-Oct-77 13:50:27, EDIT BY KIRSCHEN
;UPDATE COPYRIGHT FOR RELEASE 3
;<3-MONITOR>IMPBBN.MAC.2, 10-May-77 19:09:44, EDIT BY HURLEY
;<CLEMENTS>IMPPHY.MAC.1, 19-Jul-76 16:18:47, EDIT BY CLEMENTS
;SEPARATED PHYSICAL IMP DRIVER FROM IMPDV.MAC

;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1976, 1977, 1978 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

SEARCH PROLOG
SEARCH MACSYM,MONSYM

	TTITLE (IMPPHY,IMPBBN,< -  PHYSICAL IMP DRIVER - R CLEMENTS>)


;HOST-IMP PROTOCOL PARAMETERS
; Imp message leader bits

FRMIMP==1B1		; From imp

;HOST-HOST PROTOCOL PARAMETERS NEEDED AT THIS LEVEL

LLINK==^D72		; LAST H-H LINK TO USE

; DEVICE DEFINITION FOR BBN-STANDARD IMP10 INTERFACE

; Cono-coni bits

IMP==500			; I/O BUS DEVICE ADDRESS

IMPINB==1B32		; Input word ready
IMPOUB==1B28		; Ready for next output word
IMPEIB==1B24		; End of input
IMPGEB==1B23		; Clear eib
IMPEOB==1B22		; End of output
IMPSTO==1B21		; Stop output

IMPIOF==10B27+10		; E of cono to clear input pi asmt
IMPION==<10+IMPCHN>B27+<10+IMPCHN> ; E of cono to set input pi asmt
IMPOOF==10B31			; E of cono to clear output assmnt
IMPOON==<10+IMPCHN>B31		; E of cono to set output pi asmt
; Pi dispatch

IMPSV::	CONSO IMP,7		; Input turned off?
	JRST IMPSV1		; Yes
	CONSZ IMP,IMPINB
	JRST @IMIDSP		; Word in
	CONSZ IMP,IMPEIB
	 JRST [	CONSO IMP,IMPINB; It can happen that last input came in
		 JRST IMPEIN	; Within the last few instructions
		JRST @IMIDSP]	; If so, handle it first
IMPSV1:	CONSZ IMP,7B31		; Do nothing if no channel assigned
	CONSO IMP,IMPOUB
	RET			; NOT AN INTERRUPT FOR THIS DEVICE
	SKIPE IMPOB
	JRST @IMODSP		; Word out
	CONO IMP,IMPSTO
	UNBRK IMP		; INTERRUPT HAS BEEN PROCESSED

;CLOCK LEVEL CHECK ROUTINE

IMPCHK::MOVEI 2,^D1000
	MOVEM 2,IMPTM2		; Call this every second
	SKIPN IMPRDY		; Net on?
	 RET			; NO.
	CONSZ IMP,1B19		; Power not on
	CONSZ IMP,1B21!1B20	; Or error flop on, or host not ready?
	SKIPL IMPRDT		; And not already noticed?
	 RET
	CALL IMIERR		; Be sure it's noticed
	AOS IMPFLG		; No, cause running of ncp fork
	RET
; Start input
; called from process level when buffers made available and input is off
; and from endin processor if more buffers are available

IMISRT::CALL IMPRLQ		; IS DEVICE UP AND IMP READY?
	 RET			; No, do nothing
	SOSL IMPNFI
	SKIPN 1,IMPFRI
	 BUG(HLT,IMPNII,<NO IMP INPUT BUFFERS>)
	HLRZ 2,0(1)		; Get next free
	MOVEM 2,IMPFRI
	MOVEM 1,IMIB
	MOVN 2,0(1)		; Get count
	HRLI 1,2(2)		; Blki ptr
	MOVEM 1,IMPINP
	MOVEI 1,IMIN0
	MOVEM 1,IMIDSP
	CONSZ IMP,1B21		; If error flop is set
	 CALL IMIERR		; Be sure it gets noticed
	CONO IMP,IMPION+1B19	; Clear error and start input
	POPJ P,
; Pi service for input
; Dispatched at impsv to one of the following:
; Imin1: first word of msg
; Imis1: second word of msg
; Imi36:  36-bit msg in
; Imi32: 32-bit msg in
; Imin00: flush rest of msg in
; Impein - handles 'end input' signal

IMIN0:	BLKI IMP,IMPINP		; Read in first word
	 BUG(HLT,IMPBNS,<IMPIN-BFR NOT SETUP>)
	MOVEM 1,IMIDSP
	MOVEI 1,IMIS1
	EXCH 1,IMIDSP
	UNBRK IMP

; Second word in
; FOR SHORT LEADER FORMAT, 1ST AND 2ND WORDS TELL US WHETHER THE
; REMAINDER OF THE MESSAGE SHOULD BE READ IN 32 OR 36 BIT FORMAT.
; MAKE THAT DECISION AND SET IMIDSP TO HANDLE SUBSEQUENT WORDS.

IMIS1:	BLKI IMP,IMPINP
	BUG(HLT,IMPBN2,<IMPIN-BFR NOT SETUP>)
	MOVEM 1,IMIDSP		; Save an ac
	MOVSI 1,-^D8		; Init 36-32 bit state word
	MOVEM 1,IMIS32
	MOVE 1,IMIB		; Get buffer location
	MOVE 1,1(1)		; Header
	AND 1,[FRMIMP + 17B7 + 377B23]
	CAMLE 1,[<LLINK>B23]
	 JRST IMIS1A		; Special link/irreg msg do in 36 bit
	MOVE 1,IMIB
	LDB 1,[POINT 8,2(1),11]
	CAIE 1,^D36		; 36-bit?
	SKIPA 1,[IMI32]		; No, assume 32 (or 8)
IMIS1A:	MOVEI 1,IMI36		; Yes
	EXCH 1,IMIDSP		; Setup dispatch for rest of msg
	UNBRK IMP
; 36-bit input

IMI36:	BLKI IMP,IMPINP
	JRST .+2		; Overflowed buffer
	UNBRK IMP
	MOVEM 4,IMPIAC+4
	MOVEI 4,IMPIAC
	BLT 4,IMPIAC+3
IMIMTL:	MOVEM P,IMINP
	MOVE P,PIMSTK
	BUG(IMP,IMPML2,<MSG TOO LONG>)
	MOVE P,IMINP
	MOVEI 1,IMIN00
	MOVEM 1,IMIDSP
IMPUB:	MOVSI 4,IMPIAC		; Restore ac's
	BLT 4,4
	UNBRK IMP

IMIN00:	DATAI IMP,IMIS32	;JUST DISCARD ALL WDS UNTIL END INPUT
	UNBRK IMP

PIMSTK:	IOWD NIMSTK,IMSTK
; 32-bit input

IMI32:	MOVEM 4,IMPIAC+4
	MOVEI 4,IMPIAC
	BLT 4,IMPIAC+3		; Save ac's
	DATAI IMP,1
	SKIPL 4,IMPINP		; Get ptr to input buffer
	JRST IMIMTL		; Bfr full, msg too long
	MOVE 3,IMIS32		; Get unpacking state word
	AOBJP 4,IMIMTL		; Seq bfr ptr
	TRNN 3,777777		; Is this the zero'th state?
	 AOBJP 4,IMIMTL		; Yes point to partial word
	LSHC 1,@IMISHT(3)	; Align input bytes with destination
	DPB 1,IMIPT1(3)		; High order byte for n-1st word
	MOVEM 2,0(4)		; Low order byte for nth word
	AOBJN 3,IMI32A		; Step state
	MOVSI 3,-^D8		; Reinit state word
IMI32A:	MOVEM 3,IMIS32		; Save state
	MOVEM 4,IMPINP		; Save bfr ptr
	JRST IMPUB

; Tables for 36-32 bit conversion, indexed by state word

IMISHT:	XX==4
	REPEAT ^D8,<Z -XX
		XX=XX+4>

IMIPT1:	XX==^D32
	REPEAT ^D8,<POINT