User Tools

Site Tools


cdc:nos2.source:nam5871:macnip

MACNIP

Table Of Contents

  • [00026] GETFIL - GET A PERMANENT FILE.
  • [00074] READ - READ FILE TO CIO BUFFER.
  • [00097] REWIND - REWIND FILE.
  • [00120] ROUTE - ROUTES A FILE
  • [00156] WRITEO - WRITES ONE WORD TO FILE
  • [00196] WRITER - WRITE END OF RECORD.
  • [00222] XCOD - CONVERT INTEGER TO OCTAL DISPLAY CODE.
  • [00246] OPEN A FILE (CREATE A FILE)
  • [00249] OPEN - OPEN A FILE

Source Code

MACNIP.txt
  1. *DECK MACNIP
  2. IDENT FSTATUS
  3. ENTRY FSTATUS
  4. B1=1
  5. COMMENT DETERMINE IF FILE IS A LOCAL FILE.
  6. SPACE 4
  7. *** FSTATUS - DETERMINE IF FILE IS A LOCAL FILE.
  8. *
  9. * CALL FSTATUS(FILE)
  10. *
  11. * ENTRY (FILE) = FIRST WORD OF THE FET
  12. *
  13. * FSTATUS(FILE); ( SYMPL CALL )
  14. *
  15. * ENTRY - FILE, AN ARRAY THAT CONTAINS THE FET
  16.  
  17.  
  18. FSTATUS SUBR =
  19. SB1 1
  20. STATUS X1
  21. JP FSTATUSX
  22.  
  23. END
  24. IDENT GETFIL
  25. B1=1
  26. TITLE GETFIL - GET A PERMANENT FILE.
  27. COMMENT GET A PERMANENT FILE.
  28. SPACE 4
  29. *** NOS PERMANENT FILE MANAGER SYMPL INTERFACE ROUTINES
  30. *
  31. * GETFIL(LFN,PFN)
  32. *
  33. * LFN - LOGICAL FILE NAME, LEFT JUSTIFIED, ZERO FILLED,
  34. * SEVEN CHARACTER MAXIMUM
  35. * PFN - PERMANENT FILE NAME, SAME CHARACTERISTICS AS LFN
  36. *
  37. * THIS IS A SYMPL FUNCTION AND RETURNS THE STATUS FROM WORD 0,
  38. * BITS 17-10. SEE NOS REFERENCE MANUAL FOR PFM ERROR CODES.
  39. *
  40. PFMFET FILEB DUMMY,DUMMYL,EPR,(FET=16D) DUMMY PFM FET
  41. DUMMYL EQU 0
  42. DUMMY BSS 0
  43. SPACE 4
  44. *** GETFIL - GETS A NOS PERMANENT FILE
  45. *
  46. * SYMPL CALL - STATUS = GETFIL(LFN,PFN);
  47. *
  48. ENTRY GETFIL
  49. GETFIL SUBR = ENTRY/EXIT
  50. SB1 1
  51. SA4 X1 GET LFN
  52. SA3 A1+B1 ADDRESS OF PFN IN X3
  53. SA5 PFMFET GET CONTENTS OF FET+0
  54. MX0 -18
  55. BX7 -X0*X5 MASK OLD LFN, LEAVE LOWER 18 BITS
  56. BX6 X0*X4 MASK OUT UNWANTED BITS
  57. SA1 X3 GET PFM
  58. BX6 X6+X7 PUT FET+0 TOGETHER
  59. BX1 X0*X1 X1 = PFM
  60. SA6 A5 PUT LFN IN FET+0
  61. GET PFMFET,X1 GET FILE
  62. SPACE 2
  63. BSS 0 RETURN ERROR CODE
  64. SA1 PFMFET GET FET+0
  65. MX0 -8
  66. AX1 10 RIGHT JISTIFY BITS 17-10
  67. BX6 -X0*X1 ISOLATE ERROR CODE IN X6
  68. JP GETFILX RETURN
  69.  
  70. END
  71. IDENT READ
  72. ENTRY READ
  73. B1=1
  74. TITLE READ - READ FILE TO CIO BUFFER.
  75. COMMENT READ FILE TO CIO BUFFER.
  76. READ SPACE 4,10
  77. *** READ - READ FILE TO CIO BUFFER.
  78. *
  79. * CALL READ (FILE)
  80. *
  81. * ENTRY (FILE) = FIRST WORD OF THE FET
  82. *
  83. * READ(FILE); ( SYMPL CALL )
  84. *
  85. * ENTRY - FILE, AN ARRAY THAT CONTAINS THE FET
  86.  
  87.  
  88. READ SUBR =
  89. SB1 1
  90. READ X1,R
  91. JP READX
  92.  
  93. END
  94. IDENT REWIND
  95. ENTRY REWIND
  96. B1=1
  97. TITLE REWIND - REWIND FILE.
  98. COMMENT REWIND FILE.
  99. REWIND SPACE 4,10
  100. *** REWIND - REWIND FILE.
  101. *
  102. * CALL REWIND (FILE)
  103. *
  104. * ENTRY (FILE) = FIRST WORD OF THE FET
  105. *
  106. * REWIND(FILE); ( SYMPL CALL )
  107. *
  108. * ENTRY - FILE, AN ARRAY THAT CONTAINS THE FET
  109.  
  110.  
  111. REWIND SUBR =
  112. SB1 1
  113. REWIND X1,R
  114. JP REWINDX
  115.  
  116. END
  117. IDENT ROUTE
  118. ENTRY ROUTE
  119. COMMENT ROUTES FILE TO INPUT
  120. TITLE ROUTE - ROUTES A FILE
  121. *IF DEF,IMS
  122. *#
  123. * 1. ROUTINE NAME AUTHOR DATE
  124. * ROUTE S. KRULEVITCH 78/11/13
  125. *
  126. * 2. FUNCTIONAL DESCRIPTION
  127. * ROUTES A FILE TO DESTINATION SPECIFIED BY PARAMETER BLOCK
  128. *
  129. * 3. METHOD USED
  130. * SYMPL CALL:
  131. * ROUTE (PARAM,RECALL);
  132. *
  133. * 4. ENTRY CONDITIONS
  134. * PARAM - PARAMETER BLOCK ADDRESS
  135. * RECALL - CIO CALL WITH RECALL IF SET
  136. *
  137. * 5. EXIT CONDITIONS
  138. * NONE
  139. *
  140. * 6. COMDECKS CALLED
  141. *
  142. * 7. MACROS CALLED
  143. * ROUTE
  144. *
  145. * 8. DAYFILE MESSAGES
  146. *#
  147. *ENDIF
  148. ROUTE SUBR =
  149. SA3 A1+1 ADDRESS OF RECALL BIT
  150. SA3 X3
  151. ROUTE X1,X3
  152. EQ ROUTEX RETURN TO ENTRY POINT
  153. END
  154. IDENT WRITEO
  155. ENTRY WRITEO
  156. TITLE WRITEO - WRITES ONE WORD TO FILE
  157. COMMENT WRITES ONE WORD TO FILE
  158. *IF DEF,IMS
  159. *#
  160. *1DC WRITEO
  161. *
  162. * 1. SUBROUTINE NAME AUTHOR DATE
  163. * WRITEO C. BITTNER 83/05/23
  164. *
  165. * 2. FUNCTIONAL DESCRIPTION
  166. * THIS ROUTINE WRITES ONE WORD TO THE CIRCULAR IO BUFFER.
  167. *
  168. * 3. METHOD USED
  169. * SYMPL CALL: WRITEO(FILE,WORD);
  170. *
  171. * 4. ENTRY PARAMETERS
  172. * FILE - FIRST WORD OF THE FET
  173. * WORD - WORD TO BE TRANSFERRED
  174. *
  175. * 5. EXIT PARAMETERS
  176. * NONE
  177. *
  178. * 6. COMMON DECKS CALLED
  179. * NONE
  180. *
  181. * 7. DAYFILE MESSAGES
  182. * NONE
  183. *
  184. *#
  185. *ENDIF
  186. WRITEO SUBR =
  187. SA3 A1+B1 ADDRESS OF WORD
  188. SA3 X3 WORD
  189. BX6 X3
  190. WRITEO X1
  191. EQ WRITEO
  192. END
  193. IDENT WRITER
  194. ENTRY WRITER
  195. B1=1
  196. TITLE WRITER - WRITE END OF RECORD.
  197. COMMENT WRITE END OF RECORD.
  198. WRITER SPACE 4,10
  199. *** WRITER - WRITE END OF RECORD.
  200. *
  201. * CALL WRITER (FILE)
  202. *
  203. * ENTRY (FILE) = FIRST WORD OF THE FET
  204. *
  205. * WRITER(FILE); ( SYMPL CALL )
  206. *
  207. * ENTRY - FILE, AN ARRAY THAT CONTAINS THE FET
  208.  
  209.  
  210. WRITER SUBR =
  211. SB1 1
  212. SA3 A1+B1 ADDRESS OF LEVEL
  213. SA3 X3 LEVEL
  214. WRITER X1,X3
  215. EQ WRITERX
  216.  
  217. END
  218. IDENT XCOD
  219. ENTRY XCOD
  220. B1=1
  221. LIST F
  222. TITLE XCOD - CONVERT INTEGER TO OCTAL DISPLAY CODE.
  223. COMMENT CONVERT INTEGER TO OCTAL DISPLAY CODE.
  224. XCOD SPACE 4,10
  225. *** XCOD - CONVERT INTEGER TO OCTAL DISPLAY CODE.
  226. *
  227. * HOLLERITH = XCOD (INTEGER)
  228. *
  229. * XX = XCOD(YY); ( SYMPL CALL )
  230. *
  231. * ENTRY - YY, AN ITEM THAT CONTAINS THE INTEGER TO BE CONVERTED
  232. *
  233. * EXIT - XX, A CHAR. ITEM TO CONTAIN DISPLAY CODE ON EXIT
  234.  
  235.  
  236. XCOD SUBR = ENTRY/EXIT
  237. SB1 1
  238. SA1 X1+
  239. RJ =XCOD=
  240. JP XCODX RETURN, RESULT IN X6
  241.  
  242. END
  243. IDENT OPEN
  244. ENTRY OPEN
  245. B1=1
  246. TITLE OPEN A FILE (CREATE A FILE)
  247. COMMENT OPEN A FILE
  248. OPEN SPACE 4,10
  249. ** OPEN - OPEN A FILE
  250. *
  251. * OPEN(FILE); (SYMPL CALL)
  252. *
  253. * ENTRY - FILE AN ARRAY THAT CONTAINS THE FET
  254. *
  255. OPEN SUBR =
  256. SB1 1
  257. OPEN X1,WRITE,R
  258. EQ OPENX
  259.  
  260. END
cdc/nos2.source/nam5871/macnip.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator