*DECK TWRITE
IDENT TWRITE
EXT OMSG
EXT XTRACE
*IF DEF,IMS
*#
*1DC TWRITE
*
* 1. PROC NAME AUTHOR DATE
* TWRITE P.C.TAM 78/09/12
*
* 2. FUNCTIONAL DESCRIPTION.
* RECORD MESSAGES INTO ZZZZZDN FILE
*
* 3. METHOD USED.
* IF I/O ERROR OCCURRED ON ZZZZZDN FILE,
* RETURN.
* ELSE (NO I/O ERROR YET ON ZZZZZDN FILE),
* EXECUTE RTIME MACRO TO GET CURRENT SYSTEM RTIME.
* EXECUTE WRITEO MACRO TO WRITE CURRENT RTIME TO FILE.
* IF NO I/O ERROR YET ON ZZZZZDN FILE,
* EXECUTE WRITEW MACRO TO WRITE TRACE TEXT TO FILE.
* IF I/O ERROR OCCURRED ON ZZZZZDN FILE,
* CALL OMSG TO ISSUE INFORMATIVE DAYFILE MESSAGE.
*
* 4. ENTRY PARAMETERS.
* (A1) ADDRESS OF THE ADDRESS OF FET.
* (A1)+1 ADDRESS OF THE ADDRESS OF MESSAGE ADDRESS.
* (A1)+2 ADDRESS OF THE ADDRESS OF MESSAGE LENGTH.
* (A1)+3 ADDRESS OF THE ADDRESS OF NIP-JUST-ALLOCATE-BUFFER
* FLAG.
*
* 5. EXIT PARAMETERS.
* NONE.
*
* 6. COMMON DECKS USED.
* CYBERDEFS INPARU MACDEF BPIPBUF SYSTIME
*
* 7. ROUTINES CALLED.
* OMSG ISSUE DAYFILE MESSAGE
* RTIME GET REAL TIME MACRO.
* WRITEO WRITE WORD TO CIO BUFFER MACRO.
* WRITEW WRITE BLOCK TO CIO BUFFER MACRO.
* XTRACE TRACE CALLER
*
* 8. DAYFILE MESSAGES.
* " CIO ERROR NNB, LFN = ZZZZZDN."
*
*#
*ENDIF
*CALL MACDEF
*CALL CYBERDEFS
*CALL INPARU
*CALL SYSTIME
TW1 IFEQ ZZDN,1
ENTRY TWRITE
TWRITE SUBR = ENTRY/EXIT
SX6 A1 ADDRESS OF PARAMETER BLOCK
SA6 TEMP SAVE ADDRESS OF PARAMETER BLOCK IN TEMP
IFEQ DEBUG,1,4
SX1 XTWRITE
RJ XTRACE
SA1 TEMP
SA1 X1
MX4 5 MASK FOR ABNORMAL TERMINATION FIELD IN FET
SA2 X1 X2 = FIRST WORD OF FET
LX4 9+5 SHIFT MASK TO POSITION OF ABNORMAL TERM FLD
BX5 X4*X2 EXTRACT ABNORMAL TERMINATION FIELD FROM FET
NZ X5,TWRITEX IF I/O ERROR HAS OCCURRED ON FILE
RTIME TIM1,R
SA1 TEMP X1 = ADDRESS OF PARAMETER BLOCK
SA1 X1 X1 = ADDRESS OF FET
SA2 TIM1
BX6 X2
WRITEO X1 RECORD ELAPSED TIME
SA1 TEMP X1 = ADDRESS OF PARAMETER BLOCK
SA1 X1 X1 = ADDRESS OF FET
MX4 5 MASK FOR ABNORMAL TERMINATION FIELD IN FET
SA2 X1 X2 = FIRST WORD OF FET
LX4 9+5 SHIFT MASK TO POSITION OF ABNORMAL TERM FLD
BX5 X4*X2 EXTRACT ABNORMAL TERMINATION FIELD FROM FET
NZ X5,TWRITE2 IF I/O ERROR HAS OCCURRED ON FILE
SB1 1
SA2 A1+B1
SA3 A2+B1
SA4 A3+B1
SA2 X2 (X2)=MESSAGE ADDRESS
SA3 X3 (X3)=MESSAGE LENGTH
WRITEW X1,X2,X3
SA1 TEMP X1 = ADDRESS OF PARAMETER BLOCK
SA1 X1 X1 = ADDRESS OF FET
MX5 5 MASK FOR ABNORMAL TERMINATION FIELD IN FET
SA2 X1 X2 = FIRST WORD OF FET
LX5 9+5 SHIFT MASK TO ABNORMAL TERM FIELD POSITION
BX5 X5*X2 EXTRACT ABNORMAL TERMINATION CODE
ZR X5,TWRITEX RETURN IF NO I/O ERROR
TWRITE2 MX0 3 MASK FOR ONE OCTAL DIGIT
AX5 9 RIGHT JUSTIFY ABNORMAL TERM CODE
LX0 3 RIGHT JUSTIFY OCTAL DIGIT MASK
SA2 ERRMSGC X2 = WORD OF DAYFILE MSG TO CONTAIN CODE
BX4 X0*X5 EXTRACT LEAST SIGNIFICANT DIGIT
AX5 3 EXTRACT MOST SIGNIFICANT DIGIT
SX4 X4+33B CONVERT OCTAL DIGIT TO OCTAL DISPLAY
SX5 X5+33B CONVERT OCTAL DIGIT TO OCTAL DISPLAY
LX5 6 SHIFT MOST SIG DIGIT TO 2ND DIGIT POS
MX0 12D MASK FOR ABNORMAL TERM FIELD IN DAY MSG
BX5 X5+X4 ABNORMAL TERM CODE IN OCTAL DISPLAY CODE
LX0 42D+12D SHIFT MASK TO ABNORMAL TERM FIELD POSITION
LX5 42D SHIFT DISPLAY CODE NO TO DAY MSG POSITION
BX0 -X0*X2 CLEAR ABNORMAL TERM CODE FIELD IN DAY MSG
BX6 X0+X5 ADD ABNORMAL TERM CODE TO DAY MSG
SA6 A2
SA1 LOCMSG A1 = ADDRESS OF PARAMETER BLOCK
RJ OMSG ISSUE DAYFILE MESSAGE
EQ TWRITEX
TIM1 BSS 1
TW1 ENDIF
XTWRITE DATA L*TWRIT*
TEMP BSS 1
ERRMSG DIS ,* CIO ERROR NNB, LFN = ZZZZZDN.*
ERRMSGC EQU ERRMSG+1 WORD TO CONTAIN ABNORMAL TERM CODE
LOCMSG VFD 60D/ERRMSG LOCATION OF DAYFILE MESSAGE
END