Trailing-Edge
-
PDP-10 Archives
-
BB-F493Z-DD_1986
-
10,7/dcrser.mac
There are 9 other files named dcrser.mac in the archive. Click here to see a list.
TITLE DCRSER - CARD READER SERVICE FOR MULTIPLE RSX20F CARD READERS - V007
SUBTTL S. PAAVOLA 10 SEP 85
SEARCH F,S,DTEPRM
PRMMIN==016 ;DTEPRM MUST BE AT LEAST THIS RECENT
IFL VDTPRM-PRMMIN,<PRINTX ?PLEASE USE LATEST VERSION OF DTEPRM
PASS2
END>
$RELOC
$HIGH
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
; OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
.CPYRT<1977,1986>
;COPYRIGHT (C) 1977,1978,1979,1980,1982,1984,1986
;BY DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
;ALL RIGHTS RESERVED.
; DATE LOAD EDIT #
; ---- ---- ------
;
;
;
XP VDCRSR,007 ;DEFINE GLOBAL VERSION NUMBER FOR LOADER MAP
ENTRY DCRSER
DCRSER:
SUBTTL SYMBOL DEFINITIONS
;COLUMN 1 SPECIAL CARD CODES
COD029==5252 ;12-0-2-4-6-8
COD026==4242 ;12-2-4-8
CODEOF==7400 ;12-11-0-1
NEWEOF==0017 ;6-7-8-9
;DEVICE DEPENDENT BITS IN LEFT HALF OF DEVIOS
CR026==400 ;SET WHEN 026 TRANSLATION TO BE MADE
CRTRBL==4000 ;TROUBLE NOTICED AT INTERRUPT LEVEL
;DEVICE DEPENDENT BITS IN RIGHT HALF OF DEVIOS
SPIMBT==1B29 ;IO STATUS BIT FOR SUPER-IMAGE MODE
;BUFFER SIZES
ASBFSZ==^D18 ;BUFFER SIZE FOR ASCII MODE
BIBFSZ==^D27 ;BUFFER SIZE FOR BINARY MODE
IMBFSZ==^D28 ;BUFFER SIZE FOR IMAGE MODE
SIBFSZ==^D41 ;BUFFER SIZE FOR SUPER-IMAGE MODE
;CDR SPECIFIC STATUS BITS FROM RSX-20F
CR.RCK==1 ;READ (PHOTO) CHECK
CR.PCK==2 ;PICK CHECK
CR.SCK==4 ;STACKER CHECK
CR.HEM==10 ;HOPPER EMPTY
CR.SFL==20 ;STACKER FULL
;STATUS BITS REQUIRING OPERATOR INTERVENTION
CR.OFL==CR.RCK!CR.PCK!CR.SCK!CR.HEM!CR.SFL
SUBTTL DISPATCH TABLES
;DTESER DISPATCH TABLE FOR CDR
CPOPJ## ;(-1)
FCRDSP::EATMSG## ;(0)
EATMSG## ;(1)
EATMSG## ;(2)
F11STR ;(3) STRING DATA FROM 11
EATMSG## ;(4)
EATMSG## ;(5)
EATMSG## ;(6)
F11DVS ;(7) DEVICE STATUS
EATMSG## ;(10)
EATMSG## ;(11)
EATMSG## ;(12)
EATMSG## ;(13)
EATMSG## ;(14)
EATMSG## ;(15)
EATMSG## ;(16)
EATMSG## ;(17)
EATMSG## ;(20)
EATMSG## ;(21)
EATMSG## ;(22)
EATMSG## ;(23)
EATMSG## ;(24)
EATMSG## ;(25)
EATMSG## ;(26)
EATMSG## ;(27)
EATMSG## ;(30)
EATMSG## ;(31)
EATMSG## ;(32)
EATMSG## ;(33)
EATMSG## ;(34)
;UUOCON DISPATCH TABLE
JRST DCROFL ;OFFLINE CHECK
JRST ECOD2## ;SPECIAL ERROR STATUS
JRST DCRBSZ ;GET BUFFER SIZE
POPJ P, ;INITIALIZATION
JRST DCRHNG ;HUNG DEVICE
DCRDSP::JRST DCRREL ;RELEASE
JRST ILLOUT## ;OUTPUT CLOSE
JRST ILLOUT## ;OUTPUT
JRST DCRINP ;INPUT
SUBTTL INITIALIZATION AND SOME SMALL ROUTINES
;BUFFER SIZE SETUP ROUTINE - CALLED DURING INIT UUO.
DCRBSZ: MOVEI T1,ASBFSZ ;ASSUME ASCII
TRNN M,10 ;IS IT AN ASCII MODE?
JRST DCRBSR ;YES
MOVEI T1,BIBFSZ ;NO, ASSUME BINARY
TRNE M,4 ;IS IT BINARY?
JRST DCRBSR ;YES
MOVEI T1,IMBFSZ ;NO, MUST BE IMAGE MODE
TRNE M,1B29 ;SUPER IMAGE MODE?
MOVEI T1,SIBFSZ ;YES, 40 WORDS OF DATA
POPJ P, ;DONE
DCRBSR: TRZ M,1B29 ;SUPER-IMAGE MODE NOT ALLOWED
POPJ P, ;DONE
;HUNG DEVICE TIMEOUT
DCRHNG: TLO S,CRTRBL ;GOT TROUBLE
PUSHJ P,DCRREL ;DO THE RELEASE CODE
AOS (P) ;SKIP RETURN TO AVOID HUNG MESSAGE
PJRST DEVERR## ;TELL OPERATOR
;RELEASE
DCRREL: PUSHJ P,SETIOD## ;START UP THE USER
PUSHJ P,RTEVM## ;RETURN ANY EVM
JRST CLRACT## ;CLEAR IO ACTIVE AND RETURN
;OFF-LINE CHECK
DCROFL: MOVEI T1,EM.OFL!EM.NXD ;OFF LINE BITS
TDNN T1,DEVSTS(F) ;STILL THERE
AOS (P) ;NO, GOOD RETURN
POPJ P, ;RETURN
SUBTTL INPUT UUO
;HERE ON AN INPUT UUO
DCRINP: PUSHJ P,SAVE4## ;SAVE P1-P4
DCRGO: MOVEI T1,EM.OFL!EM.NXD ;GET OFF-LINE BIT
TLZN S,CRTRBL ;TROUBLE FROM INTERRUPT LEVEL?
TDNE T1,DEVSTS(F) ; OR DEVICE OFF-LINE?
JRST TKUSER ;YES, TELL USER
TLZN S,IOBEG ;FIRST TIME HERE?
JRST DCRIN1 ;NO, SKIP FIRST TIME STUFF
TLZ S,CR026 ;YES, TURN OFF 026 MODE
MOVSI T2,PCDRAS## ;ASCII BYTE POINTER
TRNE S,10 ;IN ASCII MODE?
MOVSI T2,PCDRBI## ;NO, BYTE POINTER FOR BINARY OR IMAGE
MOVEM T2,DEVPTR(F) ;SET BYTE POINTER INTO DDB
DCRIN1: PUSHJ P,NEWBUF## ;INITIALIZE NEW BUFFER
JRST ADRERR## ;ADDRESS ERROR
MOVE P3,DCRDUX##(F) ;GET UNIT #,,DTE INDEX
MOVE P1,CRCPDT##(P3) ;PICK UP CPU #,,DTE #
MOVE P2,[.EMCDR,,.EMACK] ;START A CARD FEEDING
HRRI P3,2 ;ONLY THE LINE NUMBER AS DATA
MOVE P4,[POINT 8,P3] ;LINE NUMBER IS IN P3
MOVEM S,DEVIOS(F) ;SAVE S
SETZM S ;NO POST PROCESSING FOR THIS MESSAGE
PUSHJ P,DTEQUE## ;QUEUE THE REQUEST
JRST TKUSER ;ERROR, GO TELL USER
MOVE S,DEVIOS(F) ;GET BACK S
TRO S,IOACT ;SET IO ACTIVE
SETZM P3 ;ZERO THE BYTE COUNT IF AT INTERRUPT LEVEL
PJRST STOIOS## ;SAVE S AND RETURN
;HERE ON OFF-LINE CARD READER
TKUSER: MOVEM S,DEVIOS(F) ;SAVE DEVIOS FOR USER
HRRZ T2,DEVBUF(F) ;ADR OF BUFFER HEADER
EXCTUX <HRRZ T1,@T2> ;CURRENT USER BUFFER
PUSHJ P,UADRCK## ;ADDRESS CHECK IT
EXCTUX <SKIPGE @T1> ;ANY DATA THERE?
PJRST RTEVM## ;YES, RETURN IT TO USER
PUSHJ P,HNGSTP## ;NOTIFY OPERATOR
JRST DCRGO ;TRY AGAIN
SUBTTL STRING INPUT
;HERE FROM DTESER ON STRING INPUT FROM THE 11
F11STR: PUSHJ P,SETRGS ;SET UP INTERRUPT REGS
JRST EATMSG## ;NO DDB
MOVSI S,CRSTR1 ;PROCESSING ROUTINE WHEN DATA IS IN
HRRI P3,^D160 ;160 8 BIT BYTES
MOVEI P4,DCRBUF##(F) ;GOES INTO DDB BUFFER
HRLI P4,(POINT 16,) ;16 BIT BYTES
MOVEI T1,SPIMBT ;THE SUPER IMAGE MODE BIT
TDNN T1,DEVIOS(F) ;SUPER IMAGE MODE?
POPJ P, ;NO, BACK TO DTESER FOR THE DATA
MOVSI S,CRSPIM ;YES, USE THIS ROUTINE INSTEAD
HRR P4,DEVPTR(F) ;DATA STRAIGHT TO USER
ADDI P4,1
POPJ P, ;BACK TO DTESER
;HERE FROM DTESER WHEN SUPER IMAGE MODE DATA HAS ARRIVED
CRSPIM: PUSHJ P,SETRGS ;SET UP INTERRUPT REGS
JRST EATMSG## ;NO DDB
MOVEI T1,^D40 ;JUST READ 40 WORDS
ADDM T1,DEVPTR(F) ;ADJUST POINTER APPROPRIATELY
JRST CRDON ;FINISH OFF
;HERE FROM DTESER WHEN THE DATA HAS ARRIVED FOR OTHER THAN SUPER IMAGE MODE
CRSTR1: PUSHJ P,SETRGS ;SET UP INTERRUPT REGS
JRST EATMSG## ;NO DDB
MOVE T4,P4 ;GET POINTER TO DATA
MOVEI T3,^D80 ;80 COLUMNS
CAMLE T3,DEVCTR(F) ;BUFFER SMALLER THAN A CARD?
MOVE T3,DEVCTR(F) ;YES, USE THE SMALLER NUMBER
TRNN S,7 ;ASCII OR BINARY?
TRNN S,10 ;OR NOT IMAGE?
JRST NORMOD ;YES, GO LOOK FOR EOF
;IMAGE MODE
CRIMG: ILDB T1,T4 ;GET A BYTE
IDPB T1,DEVPTR(F) ;GIVE IT TO USER
SOJG T3,CRIMG ;LOOP THROUGH CARD
JRST CRDON ;NO, FINISH OFF
;EOF CHECKS
NORMOD: ILDB T2,P4 ;PICK UP COLUMN ONE
TRZ T2,-10000 ;ONLY THE RAW DATA
CAIE T2,CODEOF+NEWEOF;EOF?
CAIN T2,CODEOF ;THIS TYPE?
JRST EOFCRD ;YES
CAIN T2,NEWEOF ;NEW TYPE EOF?
JRST EOFCRD ;YES
TRNE S,14 ;BINARY MODE?
JRST CRBIN ;YES, GO PROCESS CARD
;HERE FOR ASCII MODE TO READ EACH BYTE FROM THE CARD READER AND
; STORE THE CONVERTED CHARACTER IN THE USERS BUFFER. NOTE THAT
; OF THE 16 BITS WE GET FROM -20F, BIT 0 = INVALID MULIT-PUNCH,
; BITS 1-3 = ENCODED ROW PUNCHES 1-7, AND BITS 4-15 = 12 HOLES.
CAIN T2,COD026 ;026 CARD DEFINITION?
JRST SET026 ;YES, GO SET IT UP
CAIN T2,COD029 ;029 CARD DEFINITION?
JRST SET029 ;YES, SET THAT MODE
CRASC: ILDB T1,T4 ;PICK UP A BYTE
TRNE T1,100000 ;MULTIPUNCH COLUMN
JRST [MOVEI T1,"\" ;YES, GET "INVALID" CHARACTER
JRST CRASC1] ;AND STORE THAT
CAIN T1,5000 ;CONVERT [
MOVEI T1,24202 ; TO INTERNAL FORM
CAIN T1,3000 ;ALSO, CONVERT ]
MOVEI T1,22202 ; TO INTERNAL FORM
LDB T2,[POINT 3,T1,26] ;PICK UP ZONES PLUS LOW ENCODED BIT
TRNE T1,3 ;AN 8 OR 9 PUNCH?
TRC T2,7 ;YES, ENCODE THAT
TRZE T1,40000 ;COPY THIS BIT
TRO T2,10 ;TO HERE
TRNE T1,1 ;AND THIS BIT ON
TRO T1,10000 ;MEANS THIS BIT SHOULD BE ON
LSH T1,-^D12 ;POSITION THE REMAINING CODE BITS
TLNE S,CR026 ;026 MODE?
TRO T2,20 ;YES, ENCODE THAT
LDB T1,CRCVPT##(T1) ;PICK UP ASCII CHARACTER
CRASC1: IDPB T1,DEVPTR(F) ;PUT IT INTO USER'S BUFFER
SOJG T3,CRASC ;LOOP THROUGH CARD
MOVEI T1,15 ;TACK ON A CR
IDPB T1,DEVPTR(F) ;
MOVEI T1,12 ; AND A LF
IDPB T1,DEVPTR(F) ;
JRST CRDON ;FINISH OFF CARD
;BINARY CARD PROCESSING
CRBIN: MOVEI T1,-5(T2) ;CHECK FOR 7-9 PUNCH IN COLUMN 1
TRNE T1,17 ;THERE?
TRO S,IOIMPM ;NO, SET IMPROPER MODE BIT
LSH T2,-6 ;POSITION THE WORD COUNT
JUMPE T2,DCRGO ;IGNORE CARD IF COUNT=0
HRRM T2,@DEVPTR(F) ;STORE COUNT IN BUFFER
IMULI T2,3 ;CONVERT TO BYTE COUNT
CAMGE T2,T3 ;SMALL ENOUGH FOR BUFFER?
MOVEM T2,T3 ;YES, USE THIS COUNT
IBP T4 ;SKIP COLUMN ONE
ILDB P4,T4 ;GET COLUMN 2
TRZ P4,-10000 ;ONLY COLUMN PUNCHES
HRLM P4,@DEVPTR(F) ;STORE IN L.H. OF 1ST DATA WORD
HRLZ P4,P4 ;POSITION CHECK SUM
CRBIN1: ILDB T1,T4 ;PICK UP A COLUMN
IDPB T1,DEVPTR(F) ;PUT IT INTO USER'S BUFFER
SOJG T3,CRBIN1 ;LOOP THROUGH CARD
MOVEI T2,@DEVIAD(F) ;GET ADDRESS OF BUFFER AGAIN
PUSHJ P,CKS12## ;CALCULATE THE CHECKSUM
CAME T1,P4 ;GOOD CHECKSUM?
TRO S,IODTER ;NO, SET THE BIT
;END OF CARD PROCESSING
CRDON: MOVEI T1,@DEVPTR(F) ;PICK UP STOPPING PLACE
MOVEI T2,@DEVIAD(F) ;PICK UP STARTING PLACE
SUBI T1,1(T2) ;COMPUTE NUMBER OF WORDS STORED
HRRM T1,1(T2) ;STORE IN 1ST WORD OF BUFFER
AOS CDRCNT##(F) ;INCREMENT THE CARD COUNTER
PUSHJ P,SETIOD## ;LET USER CONTINUE
PUSHJ P,ADVBFF## ;ON TO NEXT BUFFER
SKIPA
JRST DCRGO ;THERE IS ONE, START IT
PUSHJ P,RTEVM## ;NO BUFFER AVAILABLE, RETURN ANY EVM
PJRST CLRACT## ;CLEAR I/O ACTIVE AND RETURN
;MODE SETTING
SET026: TLOA S,CR026 ;PUT INTO 026 MODE
SET029: TLZ S,CR026 ;PUT INTO 029 MODE
JRST DCRGO ;START A NEW CARD
;EOF CARD PROCESSING
EOFCRD: TLO S,IOEND ;SET THE MAGIC BIT FOR UUOCON
JRST CRDON ;THAT'S ALL WITH THIS CARD
SUBTTL ACCEPT DEVICE STATUS FROM 11
;HERE FROM DTESER TO ACCEPT DEVICE STATUS FROM 11 (DTESER ALREADY RECEIVED IT)
F11DVS: PUSHJ P,SETRGS ;SET UP INTERRUPT REGS
JRST EATMSG## ;NO DDB
ILDB T2,P4 ;GET FIRST (GENERAL) STATUS BYTE
ILDB T1,P4 ;GET SECOND (CDR) STATUS BYTE
HRL T2,T1 ;REPACK THE DATA
MOVE T3,DEVSTS(F) ;PICK UP OLD STATUS
MOVEM T2,DEVSTS(F) ;PUT THE DEVICE STATUS INTO THE DDB
MOVSI T1,DVOFLN ;ASSUME DEVICE ON-LINE
TRNE T2,EM.FER ;ANY BAD ERRORS?
JRST CRDVS2 ;YES
TRNE T2,EM.OFL!EM.NXD ;OFF-LINE?
JRST CRDVS3 ;YES
ANDCAM T1,DEVCHR(F) ;
IFN FTPI,<
TRNE T3,EM.OFL!EM.NXD
PUSHJ P,PSIONL## ;YES, TELL USER IT IS BACK AGAIN
> ;END IFN FTPI
PJRST EATMSG## ;EAT THE REST OF THE INDIRECT DATA
CRDVS2: TRO S,IODERR ;NOTE DEVICE ERROR
TLO S,CRTRBL ;YES, NOTE TROUBLE AT INTERRUPT LEVEL
CRDVS3: TRNN S,IOACT ;ANY I/O ACTIVE?
PJRST EATMSG## ;NO, JUST EAT THE REST OF THE MESSAGE
IORM T1,DEVCHR(F) ;NOTE DEVICE OFF-LINE
MOVEM S,DEVIOS(F) ;SAVE NEW STATUS
PUSHJ P,SETIOD##
PUSHJ P,CLRACT##
PUSHJ P,DEVERR## ;NOTIFY THE USER
PJRST EATMSG## ;AND EAT THE REST OF THE MESSAGE
SUBTTL SUPPORT SUBROUTINES
;INTERRUPT REGISTER SETUP
;CALL WITH:
; P1=CPU #,,DTE #
; P3=LINE,,DATA COUNT
SETRGS: HLRZ F,P1 ;GET CPU NUMBER
HLRZ T1,P3 ;GET DEVICE NUMBER WITHIN DTE
MOVEI F,@CRDTDV##(F) ;GET DDB ADDRESS
SKIPE F ;MAKE SURE WE GOT ONE
AOS (P) ;IF GOOD, GIVE SKIP RETURN
PJRST IOSET## ;GET THE REST OF THE AC'S
END