Trailing-Edge
-
PDP-10 Archives
-
AP-D471B-SB_1978
-
lcmipc.mac
There are 8 other files named lcmipc.mac in the archive. Click here to see a list.
TITLE LCMIPC -%1.0(004) COBOL V10./LIBOL V10. MCS INTERFACE TO IPCF
SUBTTL D. TODD/DRT/AAG/ILG/CDO 13 SEP 76
;***COPYRIGHT (C) 1974, 1975, 1976, 1977 DIGITAL EQUIPMENT CORP., MAYNARD, MASS.***
SEARCH C ;GET THE UNIVERSAL FILE DEFINITIONS
SEARCH INTERM
TWOSEG
RELOC 400000 ;TO THE HIGH SEGMENT
;AC DEFINITIONS
T1=1
T2=T1+1
T3=T2+1
T4=T3+1
P=17
;ADDITIONAL DEFINITION
W2PLSH==-11 ;SHIFT TO CONVERT WORDS TO PAGES
P2WLSH==11 ;SHIFT TO CONVERT PAGES TO WORDS
PAGSIZ==^D512 ;WORDS/PAGE
MNLEN==^D24 ;MCS SYSTEM NAME LENGTH IN CHARACTERS
;MUST BE .LE.29 AND .GE.1
;INTERNAL ENTRY POINTS
ENTRY SNDPAG,RECPAG,GTPAG.,KILPAG,ONCE,SAVT
ENTRY CREPAG
IFE MCS,<
SNDPAG: RECPAG: GTPAG.: KILPAG: ONCE: SAVT: CREPAG:
OUTSTR [ASCIZ "?LIBOL IS NOT CONFIGURED TO SUPPORT MCS.
"]
JRST KILL.##
END
>
;
;
;EXTERNAL DEFINITIONS FOUND IN LIBIMP
EXTERNAL PIDMCP,PIDLCM,IPCFLG
EXTERNAL PAKSND,MSGSND,PAKREC,MSGREC
EXTERNAL PAGOFF,PAGBIT
;EXTERNAL FOUND IN LCM.MAC
EXTERNAL LCMFTL
;SUBROUTINE SNDPAG - SEND A PAGE TO THE MCP
;CALL MOVEI T1,PAGE NUMBER ;PAGE TO SEND
; CPOPJ ;CAN NOT SEND THE PAGE
; CPOPJ1 ;PAGE HAS BEEN SENT TO THE MCP
SNDPAG:: ;ENTRY POINT
PUSH P,T1 ;SAVE THE PAGE NUMBER
HRLI T1,PAGSIZ ;ADD THE PAGE SIZE
MOVEM T1,PAKSND+.IPCFP ;STORE THE POINTER
MOVE T1,PIDMCP ;GET THE PID OF MCP
MOVEM T1,PAKSND+.IPCFR ;STORE THE RECEIVER
SETZM PAKSND+.IPCFS ;CLEAR THE SENDER
MOVEI T1,IP.CFV ;SEND IN PAGE MODE
PUSHJ P,SNDIPC ;SEND TO IPCF
JRST SNDPAE ;ERROR
POP P,T1 ;RESTORE THE PAGE NUMBER
PJRST PUTPAG ;REMOVE THE PAGE FROM THE TABLES
SNDPAE: EXCH T1,(P) ;PUT THE ERROR BITS ON THE STACK
JRST T1POPJ ;RETURN WITH ERROR IN T1
;SUBROUTINE SNDIPC SEND A PACKET OR PAGE
;CALL MOVE T1,FLAGS
; PUSHJ P,SNDIPC
;RETURN CPOPJ ;ERROR T1=ERROR CODE
; CPOPJ1 ;MESSAGE SENT
SNDIPC: ;ENTRY POINT
MOVEM T1,PAKSND+.IPCFL ;STORE THE FLAGS
SNDREP: SKIPA T1,.+1 ;LOAD THE CONTROL WORD POINTER
XWD ^D4,PAKSND ;ARGUMENT TO THE IPCFS UUO
IPCFS. T1, ;SEND THE MESSAGE
SKIPA ;ERROR
JRST CPOPJ1 ;RETURN
CAIE T1,IPCRS% ;OVER QUOTA ERROR?
CAIN T1,IPCDD% ;NO-DISABLED DESTINATION?
JRST SNOZT ;YES-GO SLEEP FOR A BIT
CAIE T1,IPCRR% ;NO ROOM IN REC. QUEUE?
CAIN T1,IPCRY% ;NO ROOM IN SYSTEM
JRST SNOZT
POPJ P,
SNOZT: SKIPA T1,.+1 ;OTHERWISE SLEEP A WHILE AND TRY AGAIN
EXP HB.IPC+1 ; ONE WINK OR IPC INTERRUPT
HIBER T1, ; ...
SLEEP T1, ; HIBER FAILED??
JRST SNDREP ;TRY AGAIN
;SUBROUTINE RECPAG - RECEIVE A PAGE FROM AN MPP
;CALL PUSHJ P,RECPAG
;RETURN CPOPJ ;NO PAGES AVAILABLE
; CPOPJ1 ;GET A PAGE T1=XWD SIZE,PAGE NUMBER
; ;T1 = PAGE #
RECPAG:: ;ENTRY POINT
PUSHJ P,GTPAG. ;GET A FREE PAGE (IPC POOL)
POPJ P, ;ERROR RETURN
PUSH P,T1 ;SAVE THE PAGE NUMBER
HRLI T1,PAGSIZ ;INSERT THE PAGE SIZE
MOVEM T1,PAKREC+.IPCFP ;STORE THE MESSAGE POINTER
SKIPA T1,.+1 ;GET THE RECEIVE FALGS
EXP IP.CFV
PUSHJ P,RECIPC ;GET THE PAGE
JRST RECPAE ;RECEIVE PAGE ERROR
PJRST TPOPJ1 ;SKIP RETURN
RECPAE: ;RECEVICE PAGE ERROR
EXCH T1,(P) ;GET THE APGE NUMBER BACK
PUSHJ P,PUTPAG ;RETURN THE PAGE
JFCL ;DON'T CARE
JRST T1POPJ ;RESTORE THE ERROR BITS(RETURN)
;SUBROUTINE RECIPC RECEIVE A MESSAGE FROM IPCF
;CALL MOVE T1,FLAGS
; PUSHJ P,RECIPC
;RETURN CPOPJ ;ERROR T1=ERROR
; CPOPJ1 ;GOT THE MESSAGE
RECIPC: ;ENTRY POINT
MOVEM T1,PAKREC+.IPCFL ;STORE THE FLAGS
SKIPA T1,.+1 ;LOAD THE ARGUEMNT
XWD ^D4,PAKREC
IPCFR. T1, ;GET THE MESSAGE
POPJ P, ;ERROR RETURN
MOVEM T1,IPCFLG ;STORE THE NEW FLAGS
LDB T1,IPCEBT ;GET THE ERROR FIELD
JUMPN T1,CPOPJ ;EXIT WITH ERROR
JRST CPOPJ1 ;GOOD RETURN
IPCEBT: POINT 6,PAKREC+.IPCFL,29
;SUBROUTINE TO REMOVE JUNK FROM THE RECEIVE QUEUE
;CALL PUSHJ P,PAKJNK ;REMOVE A JUNK PACKET
;CALL PUSHJ P,PAGJNK ;REMOVE A JUNK PAGE
;RETURN CPOPJ
PAGJNK: TROA T1,IP.CFV ;REMOVE JUNK PAGES
PAKJNK: TRZ T1,IP.CFV ;REMOVE A JUNK PACKET
ANDI T1,IP.CFV ;SAVE ONLY THE PAGE BIT
HRLI T1,(IP.CFT!IP.CFB) ;SET PACKET TO LONG BIT
SETZM PAKREC+.IPCFP ;CLEAR THE LENGTH FIELD
PUSHJ P,RECIPC ;CLEAR THE PACKET
JFCL
POPJ P, ;RETURN
SUBTTL FREE PAGE TABLE ROUTINES
;SUBROUTINE GTPAG. - GET A FREE PAGE FROM THE IPC PAGES
;CALL PUSHJ P,T1
;RETURN CPOPJ ;NO PAGES AVAILABLE
; CPOPJ1 ;OK T1= THE PAGE NUMBER
GTPAG..:: ;ENTRY POINT
MOVSI T1,(1B0) ;SET UP A SIMPLE MASK
GETPA1: TDNN T1,PAGBIT ;CHECK FOR AN AVAILABLE PAGE
JRST GETPA2 ;YES
LSH T1,-1 ;NO SHIFT A BIT
JUMPN T1,GETPA1 ;TRY AGAIN
POPJ P, ;NO PAGES
GETPA2: ;FOUND A PAGE
IORM T1,PAGBIT ;SET IN USE
JFFO T1,.+1 ;COUNT THE LEADING ZEROS
ADD T2,PAGOFF ;ADD THE OFFSET
MOVE T1,T2 ;COPY THE PAGE NUMBER
JRST CPOPJ1 ;SKIP RETURN
;SUBROUTINE CREPAG - CREATE A VITUAL PAGE ON THE PAGING DEVICE
;CALL MOVEI T1,PAGE NUMBER
; PUSHJ P,CREPAG
; CPOPJ ;CAN NOT CREAT PAGE
; CPOPJ1 ;PAGE CREATED
CREPAG: ;ENTRY POINT
MOVEI T3,(T1) ;COPY THE PAGE NUMBER
MOVEI T2,1 ;ARG LIST COUNT
SKIPA T1,.+1 ;PAGE. UUO ARGUEMNT
CREP.1: XWD .PAGCD,T2
PAGE. T1,
SKIPA
JRST CPOPJ1 ;SKIP RETURN
TLO T3,(PA.GCD) ;TRY TO MAKE IT VIRTUAL
MOVE T1,CREP.1
PAGE. T1,
POPJ P, ;TO BAD-
JRST CPOPJ1
;
;SUBROUTINE KILPAG CALLS REMPAG AND PUTPAG
KILPAG: PUSH P,T1 ;SAVE PAGE #
PUSHJ P,REMPAG
HALT . ;ERROR
POP P,T1 ;GET PAGE # BACK
PUSHJ P,PUTPAG
POPJ P, ;RETURN
POPJ P, ;RETURN
;
;
;
;SUBROUTINE PUTPAG MARK A PAGE AS BEING REMOVE FROM THE IPCR SPACE
;CALL MOVEI T1,PAGE NUMBER
; PUSHJ P,PUTPAG
;RETURN CPOPJ ;PAGE ALREADY REMOVED
; CPOPJ1 ;OK
PUTPAG: ;ENTRY POINT
SUB T1,PAGOFF ;OFFSET THE PAGE NUMBER
MOVSI T2,(1B0) ;SET UP A MASK
MOVNS T1 ;NEGATE THE PAGE NUMBER
LSH T2,(T1) ;POSITION THE BIT
TDNN T2,PAGBIT ;IS THE BIT ALREADY AOFF
POPJ P, ;YES, ERROR EXIT
ANDCAM T2,PAGBIT ;CLEAR THE BIT
JRST CPOPJ1 ;EXIT
;SUBROUTINE REMPAG - REMOVE A PAGE FROM THE VIRTUAL ADDRESSING SPACE
;CALL MOVEI T1,PAGE NUMBER
; PUSHJ P,REMPAG
;RETURN CPOPJ ;ERROR T1=ERROR CODE
; CPOPJ1 ;PAGE REMOVED
REMPAG: ;ENTRY POINT
MOVEI T3,(T1) ;COPY THE PAGE NUMBER
TLO T3,(1B0) ;DISTROY FLAG
MOVEI T2,1 ;ARGUEMNT LIST COUNT
SKIPA T1,.+1 ;PAGE. UUO ARGUMENT
XWD .PAGCD,T2
PAGE. T1,
POPJ P, ;ERROR T1=ERROR CODE
JRST CPOPJ1 ;SKIP RETURN
SUBTTL COMMON SUBROUTINES
TPOPJ1: POP P,T1 ;RESTORE T1
CPOPJ1: AOSA (P) ;SKIP RETURN
T1POPJ: POP P,T1 ;RESTORE T1
CPOPJ: POPJ P, ;RETURN
SAVT:: EXCH T1,(P) ;SAVE T1, GET RETURN ADR.
PUSH P,T2
PUSH P,T3 ;SAVE T3
PUSH P,T4
PUSH P,.+3 ;GET THE RETURN ADDRESS
HRLI T1,-4(P) ;GET THE ADDRESS OF P1
JRA T1,(T1) ;GO BACK TO CALL, RESTORE T1
CAIA . ;POPJ RETURN
AOS -4(P) ;CPOPJ1 - SET SKIP RETURN
POP P,T4
POP P,T3
POP P,T2 ;RESTORE T3 ACS
POP P,T1
POPJ P, ;AND RETURN
;SUBROUTINE SNOOZ - WAIT FOR IPCF ACTIVITY
;CALL PUSHJ P,SNOOZ
;RETURN CPOPJ ;IPCF INTERRUPT T1=CONDITIONS
SNOOZ1: SKIPA T1,.+1 ;LOAD FLAGS
EXP HB.IPC ;IPCF ONLY
HIBER T1,
SLEEP T1, ;IF FAILURE
SNOOZ:: SKIPA T1,.+1 ;LOAD QUERY FLAGS
XWD 4,PAKREC ;INTO RECEIVE AREA
IPCFQ. T1, ;DO THE QUERY
JRST SNOOZ1 ;TRY AGAIN ON ERRORS
SKIPN T1,PAKREC+.IPCFP;GET THE PACKET POINTE
JRST SNOOZ1 ;NONE THERE TRY LATER
HRR T1,PAKREC+.IPCFL;GET THE FLAGS
POPJ P, ;RETURN WITH PACKET POINTER
;SUBROUTINE ONCE - GET THE WORLD STARTED
;CALL PUSHJ P,ONCE
;RETURN CPOPJ ;WORLD IS STARTED
MHNAME: SIXBIT/MCS-10/ ;NAME OF MCS SYSTEMS (DONE BY SETNAM)
ONCE:: ;ENTRY POINT
SKIPE PIDMCP ;MCP HAVE A PID
POPJ P, ;YES, EXIT
SKIPN T1,.JBHRL
MOVEI T1,657777 ;MAGIC PAGE #
MOVEI T1,1(T1)
LSH T1,W2PLSH
MOVEM T1,PAGOFF ;STORE THE PAGE OFFSET
SETO T1, ;OUR JOB
CTLJOB T1, ;GET CONTROLLING JOB NUMBER
SETO T1, ;NOT IMPLEMENTED (CAN NOT HAPPEN)
JUMPLE T1,NOPTY ;JUMP IF NO CONTROLLING JOB
HRL T2,T1 ;MOVE OVER THE JOB NUMBER
HRRI T2,.GTPRG ;FIND CONTROLLERS NAME
GETTAB T2, ;FROM THE MONITOR TABLES
SETZ T2, ;NICE TRY THOUGH
CAMN T2,MHNAME ;CONTROLLED BY AN MCS SYSTEM
JRST ONCE1 ;YES, GO DO AUTOMATIC STUFF
NOPTY: ;NO PTY CONTROL
OUTSTR [ASCIZ/%LCM ENTER THE MCS-10 SYSTEM NAME
*/]
SKIPA T4,.+1 ;LOAD A BYTE POINTER FORTHE ANSWER
POINT 7,MSGSND+.IPCS2 ;COPY SYSTEM AND
SETZM MSGSND+.IPCS1 ;CLEAR THE ALTERNATE
MOVEI T3,MNLEN ;MAX NAME SIZE
NOPTY1: INCHWL T1 ;GET A CHARACTER
CAIN T1,15 ; DON'T STORE<CR>'S OR <LF>'S
JRST NOPTY1 ;...
CAIE T1,12 ;...
IDPB T1,T4 ;STORE THE CHARACTER
CAIE T1,12 ;LINE FEED
SOJG T3,NOPTY1 ;OR END OF MESSAGE TEXT
SETZ T1, ;ADD A NULL BYTE
IDPB T1,T4 ;TO TERMINATE THE ASCIZ STRING
MOVEI T1,.IPCIW ;FIND THE PID FOR MCP
MOVEM T1,MSGSND+.IPCS0 ;STORE THE FUNCTION CODE
SKIPA T1,.+1 ;LOAD THE MESSAGE POINTER
XWD 10,MSGSND ;..
MOVEM T1,PAKSND+.IPCFP ;STORE
SETZ PAKSND+.IPCFS ;CLEAR SENDERS PID
SETZB T1,PAKSND+.IPCFR ;CLEAR RECEIVER PID(ASSUMES SYSINFO)
PUSHJ P,SNDIPC ;SEND THE MESSAGE
JRST LCMFTL ;NO SYSINFO ETC.
NOPTY2: PUSHJ P,SNOOZ ;WAIT FOR A RESPONSE
TRNE T1,IP.CFV ;PAGE MODE
JRST NOPTY3 ;REMOVE IT
ANDI T1,IP.CFC ;ISOLATE THE FUNCTION CODE
CAIN T1,<.IPCCF>B32 ;FROM INFO
JRST NOPTY4 ;YES, GET THE PID OF MCP
PUSHJ P,PAKJNK ;RECEIVE THE JUNK
JRST NOPTY2 ;TRY AGAIN
NOPTY3: PUSHJ P,PAGJNK ;REMOVE THE PAGE
JRST NOPTY2 ;TRY AGAIN
NOPTY4: ;GOT A RESPONSE
SKIPA T1,.+1 ;LOAD THE MESSAGE POINTER
XWD 10,MSGREC
MOVEM T1,PAKREC+.IPCFP;STORE IN THE PACKET DESCRIPTOR
SETZ T1, ;CLEAR THE FLAGS
PUSHJ P,RECIPC ;GET THE PAGE
JRST ILLNAM ;NOT A VALID RESPONSE
HRRZ T1,MSGREC+.IPCS0 ;GET THE FUNCTION CODE
CAIE T1,.IPCIW ;REQUESTING A PID
JRST NOPTY2 ;NOT CORRECT RESPONSE
MOVE T1,MSGREC+.IPCS1;YES GET THE PID OF MCP
MOVEM T1,PIDMCP ;STORE THE PID OF MCP
;TELL THE MCP WE ARE AROUND VIA [SYS]INFO
;
PJOB T1, ; GET OUR JOB NUMBER
PUSHJ P,GPIDL ;SEE IF THERE ARE ANY PIDS HANGING AROUNF FOR US
PJRST GETPID ; NO PIDS SO MAKE ONE AND TELL MCS
POPJ P, ;GOT A PID FROM GPIDL
ILLNAM: ;INVALID NAME FOR MCS-10
OUTSTR [ASCIZ/
%LCM - UNKNOWN MCS-10 SYSTEM TRY AGAIN
/]
SKIPA T1,.+1 ;CLEAR THE PACKET TO TRY AGAIN
XWD MSGSND+.IPCS1,MSGSND+.IPCS1+1
SETZM MSGSND+.IPCS1
BLT T1,MSGSND+.IPCS1+<MNLEN/5+1>
JRST NOPTY
SUBTTL SET UP THE PID'S FOR US(LCM) AND MCP
ONCE1: ;CONNECT TO THE MCP
PUSHJ P,GPIDL ;GET THE PID LIST FOR MCP
JRST LCMFTL ;FATAL ERROR
MOVEM T1,PIDMCP ;STORE THE PID OF MCP
PJOB T1, ;GET OUR JOB NUMBER
PUSHJ P,GPIDL ;GET OUR PID LIST
JRST LCMFTL ; NO LIST... BUG IN MCS-10
MOVEM T1,PIDLCM ;STORE THE PID
POPJ P, ;RETURN OPEN COMPLETE
;SUBROUTINE GPIDL - GET A PID LIST
;CALL MOVEI T1,JOB NUMBER
; PUSHJ P,GPIDL
;RETURN CPOPJ ;NO PIDS AVAILABLE
; CPOPJ1 ;PID LIST STARTS AT MSGREC+2
; ;RETURNS THE FIRST PID OF THE PID LIST IN T1
GPIDL: ;ENTRY POINT
MOVEM T1,MSGSND+.IPCS1;STORE THE JOB NUMBER
MOVEI T1,.IPCSP ;GET THE FUNCTION
MOVEM T1,MSGSND+.IPCS0;STORE THE FUNCTION
SETZM PAKSND+.IPCFS ;CLEAR SENDER
SKIPA T1,.+1 ;FIND THE PID OF IPCC
%IPCCP
GETTAB T1, ;GET THE PID
POPJ P, ;FATAL ERROR
MOVEM T1,PAKSND+.IPCFR;STORE THE RECEIVER PID (IPCCP)
SKIPA T1,.+1 ;LOAD THE MESSAGE POINTER
XWD ^D8,MSGSND ;..
MOVEM T1,PAKSND+.IPCFP ;STORE THE POINTER
SETZ T1, ;CLEAR THE FLAGS
SETZM MSGSND+2
SKIPA T2,.+1 ;CLEAR THE REST OF MSGSND TO 0
MSGSND+2,,MSGSND+3
BLT T2,MSGSND+7
PUSHJ P,SNDIPC ;SEND
POPJ P, ;FATAL
GPDL2: PUSHJ P,SNOOZ ;WAIT FOR RESPONSE
TRNN T1,IP.CFV ;PAGE MODE
JRST GPDL3 ;NO, GOT A PACKET
PUSHJ P,PAGJNK ;READ JUNK PAGE
JRST GPDL2 ;TRY AGAIN
GPDL3: SKIPA T1,.+1 ;MESSAGE POINTER
XWD ^D8,MSGREC
MOVEM T1,PAKREC+.IPCFP;STORE THE POINTER
SETZ T1, ;CLEAR THE FLAGS
PUSHJ P,RECIPC ;READ THE PACKET
JRST GPDL2 ;TRY AGAIN
HRRZ T1,MSGREC+.IPCS0 ;GET THE FUNCTION
CAIE T1,.IPCSP ;PID LIST REQUEST
JRST GPDL2 ;WAIT FOR ANOTHER RESPONSE
SKIPN T1,MSGREC+.IPCS2;GET THE PID
POPJ P, ;NO PIDS
JRST CPOPJ1 ;GOOD EXIT ATLEAST ONE PID
;SUBROUTINE GETPID - GET A PID
;CALL PUSHJ P,GETPID
;RETURN CPOPJ ;ALWAYS PID IN T1 & STORED IN PIDLCM
GETPID: MOVE T2,PIDMCP## ;HERE IF A DEBUGGING MPP
MOVEM T2,MSGSND+.IPCS1
MOVEI T1,.IPCII ;MAKE A PID FOR US
MOVEM T1,MSGSND+.IPCS0;STORE THE FUNCTION CODE
SKIPA T1,.+1 ;GET PART ONE OF THE NAME
ASCII /MPP(#/
MOVEM T1,MSGSND+.IPCS2 ;STORE THE NAME
SKIPA T4,.+1 ;LOAD AN OUTPUT POINTER
POINT 7,MSGSND+.IPCS2+1
PJOB T1, ;GET THE JOB NUMBER
IDIVI T1,12 ;CONVERT TO DECIMAL
PUSH P,T2 ;SAVE THE LOW ORDER DIGIT
IDIVI T1,12 ;AND AGAIN
MOVEI T1,"0"(T1) ;CONVERT TO ASCII
IDPB T1,T4 ;STORE
MOVEI T1,"0"(T2) ;NEXT
IDPB T1,T4 ;STORE
POP P,T1
MOVEI T1,"0"(T1) ;TO ASCII
IDPB T1,T4 ;STORE
MOVEI T1,")" ;CLOSEING
IDPB T1,T4 ;STORE
SKIPA T1,.+1 ;LOAD MESSAGE POINTER
XWD ^D8,MSGSND
MOVEM T1,PAKSND+.IPCFP;STOE THE POINTER
SETZM PAKSND+.IPCFS ;CLEAR SENDER
SETZB T1,PAKSND+.IPCFR;CLEAR RECEIVER AND FLAGS
PUSHJ P,SNDIPC ;SEND THE MESSAGE
JRST LCMFTL ;FATAL NO SYSINFO
GETPD1: PUSHJ P,SNOOZ ;WAIT FOR A RESPONSE
TLNN T1,IP.CFV ;PAGE MODE
JRST GETPD2 ;NO,CONTINUE
PUSHJ P,PAGJNK ;YES, EAT THE PAGE
JRST GETPD1 ;TRY AGAIN
GETPD2: ANDI T1,IP.CFC ;ISOLATE THE FUNCTION CODE
CAIN T1,<.IPCCF>B32 ;FROM INFO
JRST GETPD3 ;YES CONTINUE
PUSHJ P,PAKJNK ;EAT THE JUNK PACKET
JRST GETPD1 ;TRY AGAIN
GETPD3: SKIPA T1,.+1 ;MESSAGE POINTER
XWD ^D8,MSGREC
MOVEM T1,PAKREC+.IPCFP;STORE THE POINTER
SETZ T1, ;CLEAR THE FLAGS
PUSHJ P,RECIPC ;READ THE PACKET
JRST GETPD1 ;TRY AGAIN
HRRZ T1,MSGREC+.IPCS0;GET THE FUNCTION CODE
CAIE T1,.IPCII ;MAKE PID
JRST GETPD1 ;TRY AGAIN
MOVE T1,MSGREC+.IPCS1;YES,GET THE PID
MOVEM T1,PIDLCM ;STORE OUT PID
POPJ P, ;RETURN
END