User Tools

Site Tools


cdc:nos2.source:nam5871:twrite

TWRITE

Table Of Contents

Source Code

TWRITE.txt
  1. *DECK TWRITE
  2. IDENT TWRITE
  3. EXT OMSG
  4. EXT XTRACE
  5. *IF DEF,IMS
  6. *#
  7. *1DC TWRITE
  8. *
  9. * 1. PROC NAME AUTHOR DATE
  10. * TWRITE P.C.TAM 78/09/12
  11. *
  12. * 2. FUNCTIONAL DESCRIPTION.
  13. * RECORD MESSAGES INTO ZZZZZDN FILE
  14. *
  15. * 3. METHOD USED.
  16. * IF I/O ERROR OCCURRED ON ZZZZZDN FILE,
  17. * RETURN.
  18. * ELSE (NO I/O ERROR YET ON ZZZZZDN FILE),
  19. * EXECUTE RTIME MACRO TO GET CURRENT SYSTEM RTIME.
  20. * EXECUTE WRITEO MACRO TO WRITE CURRENT RTIME TO FILE.
  21. * IF NO I/O ERROR YET ON ZZZZZDN FILE,
  22. * EXECUTE WRITEW MACRO TO WRITE TRACE TEXT TO FILE.
  23. * IF I/O ERROR OCCURRED ON ZZZZZDN FILE,
  24. * CALL OMSG TO ISSUE INFORMATIVE DAYFILE MESSAGE.
  25. *
  26. * 4. ENTRY PARAMETERS.
  27. * (A1) ADDRESS OF THE ADDRESS OF FET.
  28. * (A1)+1 ADDRESS OF THE ADDRESS OF MESSAGE ADDRESS.
  29. * (A1)+2 ADDRESS OF THE ADDRESS OF MESSAGE LENGTH.
  30. * (A1)+3 ADDRESS OF THE ADDRESS OF NIP-JUST-ALLOCATE-BUFFER
  31. * FLAG.
  32. *
  33. * 5. EXIT PARAMETERS.
  34. * NONE.
  35. *
  36. * 6. COMMON DECKS USED.
  37. * CYBERDEFS INPARU MACDEF BPIPBUF SYSTIME
  38. *
  39. * 7. ROUTINES CALLED.
  40. * OMSG ISSUE DAYFILE MESSAGE
  41. * RTIME GET REAL TIME MACRO.
  42. * WRITEO WRITE WORD TO CIO BUFFER MACRO.
  43. * WRITEW WRITE BLOCK TO CIO BUFFER MACRO.
  44. * XTRACE TRACE CALLER
  45. *
  46. * 8. DAYFILE MESSAGES.
  47. * " CIO ERROR NNB, LFN = ZZZZZDN."
  48. *
  49. *#
  50. *ENDIF
  51. *CALL MACDEF
  52. *CALL CYBERDEFS
  53. *CALL INPARU
  54. *CALL SYSTIME
  55.  
  56. TW1 IFEQ ZZDN,1
  57.  
  58. ENTRY TWRITE
  59.  
  60. TWRITE SUBR = ENTRY/EXIT
  61.  
  62. SX6 A1 ADDRESS OF PARAMETER BLOCK
  63. SA6 TEMP SAVE ADDRESS OF PARAMETER BLOCK IN TEMP
  64.  
  65. IFEQ DEBUG,1,4
  66. SX1 XTWRITE
  67. RJ XTRACE
  68. SA1 TEMP
  69. SA1 X1
  70.  
  71. MX4 5 MASK FOR ABNORMAL TERMINATION FIELD IN FET
  72. SA2 X1 X2 = FIRST WORD OF FET
  73. LX4 9+5 SHIFT MASK TO POSITION OF ABNORMAL TERM FLD
  74. BX5 X4*X2 EXTRACT ABNORMAL TERMINATION FIELD FROM FET
  75. NZ X5,TWRITEX IF I/O ERROR HAS OCCURRED ON FILE
  76.  
  77. RTIME TIM1,R
  78. SA1 TEMP X1 = ADDRESS OF PARAMETER BLOCK
  79. SA1 X1 X1 = ADDRESS OF FET
  80. SA2 TIM1
  81. BX6 X2
  82. WRITEO X1 RECORD ELAPSED TIME
  83. SA1 TEMP X1 = ADDRESS OF PARAMETER BLOCK
  84. SA1 X1 X1 = ADDRESS OF FET
  85. MX4 5 MASK FOR ABNORMAL TERMINATION FIELD IN FET
  86. SA2 X1 X2 = FIRST WORD OF FET
  87. LX4 9+5 SHIFT MASK TO POSITION OF ABNORMAL TERM FLD
  88. BX5 X4*X2 EXTRACT ABNORMAL TERMINATION FIELD FROM FET
  89. NZ X5,TWRITE2 IF I/O ERROR HAS OCCURRED ON FILE
  90.  
  91. SB1 1
  92. SA2 A1+B1
  93. SA3 A2+B1
  94. SA4 A3+B1
  95. SA2 X2 (X2)=MESSAGE ADDRESS
  96. SA3 X3 (X3)=MESSAGE LENGTH
  97. WRITEW X1,X2,X3
  98. SA1 TEMP X1 = ADDRESS OF PARAMETER BLOCK
  99. SA1 X1 X1 = ADDRESS OF FET
  100. MX5 5 MASK FOR ABNORMAL TERMINATION FIELD IN FET
  101. SA2 X1 X2 = FIRST WORD OF FET
  102. LX5 9+5 SHIFT MASK TO ABNORMAL TERM FIELD POSITION
  103. BX5 X5*X2 EXTRACT ABNORMAL TERMINATION CODE
  104. ZR X5,TWRITEX RETURN IF NO I/O ERROR
  105.  
  106. TWRITE2 MX0 3 MASK FOR ONE OCTAL DIGIT
  107. AX5 9 RIGHT JUSTIFY ABNORMAL TERM CODE
  108. LX0 3 RIGHT JUSTIFY OCTAL DIGIT MASK
  109. SA2 ERRMSGC X2 = WORD OF DAYFILE MSG TO CONTAIN CODE
  110. BX4 X0*X5 EXTRACT LEAST SIGNIFICANT DIGIT
  111. AX5 3 EXTRACT MOST SIGNIFICANT DIGIT
  112. SX4 X4+33B CONVERT OCTAL DIGIT TO OCTAL DISPLAY
  113. SX5 X5+33B CONVERT OCTAL DIGIT TO OCTAL DISPLAY
  114. LX5 6 SHIFT MOST SIG DIGIT TO 2ND DIGIT POS
  115. MX0 12D MASK FOR ABNORMAL TERM FIELD IN DAY MSG
  116. BX5 X5+X4 ABNORMAL TERM CODE IN OCTAL DISPLAY CODE
  117. LX0 42D+12D SHIFT MASK TO ABNORMAL TERM FIELD POSITION
  118. LX5 42D SHIFT DISPLAY CODE NO TO DAY MSG POSITION
  119. BX0 -X0*X2 CLEAR ABNORMAL TERM CODE FIELD IN DAY MSG
  120. BX6 X0+X5 ADD ABNORMAL TERM CODE TO DAY MSG
  121. SA6 A2
  122. SA1 LOCMSG A1 = ADDRESS OF PARAMETER BLOCK
  123. RJ OMSG ISSUE DAYFILE MESSAGE
  124.  
  125. EQ TWRITEX
  126.  
  127. TIM1 BSS 1
  128. TW1 ENDIF
  129. XTWRITE DATA L*TWRIT*
  130. TEMP BSS 1
  131.  
  132. ERRMSG DIS ,* CIO ERROR NNB, LFN = ZZZZZDN.*
  133. ERRMSGC EQU ERRMSG+1 WORD TO CONTAIN ABNORMAL TERM CODE
  134.  
  135. LOCMSG VFD 60D/ERRMSG LOCATION OF DAYFILE MESSAGE
  136.  
  137. END
cdc/nos2.source/nam5871/twrite.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator