User Tools

Site Tools


plato:source:plaopl:defsub

DEFSUB

Table Of Contents

  • [00005] SUBROUTINES USED BY -DEFINE- OVERLAY
  • [00013] DEFINE/SEGMENT/UNITS OVERLAY CALLS
  • [00045] -GETNAME-
  • [00124] -SYMCHK-

Source Code

DEFSUB.txt
  1. DEFSUB
  2. * /--- FILE TYPE = E
  3. * /--- BLOCK IDENT 00 000 75/05/29 20.21
  4. IDENT DEFSUB
  5. TITLE SUBROUTINES USED BY -DEFINE- OVERLAY
  6. *
  7. CST
  8. *
  9. EXT ECSPRTY,KEYTYPE
  10. *
  11. *
  12. * /--- BLOCK DEFSUB 00 000 81/07/16 04.24
  13. TITLE DEFINE/SEGMENT/UNITS OVERLAY CALLS
  14. *
  15. *
  16. *
  17. ENTRY DEFREAD
  18. DEFREAD SA1 LOCAL IF LOCAL SET ACTIVE, PURGE IT
  19. ZR X1,DFRD10 IF LOCAL SET NOT ACTIVE
  20. *
  21. MX6 0 CLEAR LOCAL FLAG
  22. SA6 A1
  23. EXEC DEFOV,3 PURGE LOCAL SET FOR GLOBAL SET
  24. *
  25. ENTRY DFRD10
  26. DFRD10 EXEC DEFOV,0 NORMAL DEFINE INTERPRETATION
  27. *
  28. *
  29. *
  30. ENTRY SEGREAD
  31. SEGREAD EXEC SEGOV,0
  32. *
  33. *
  34. *
  35. ENTRY UNSREAD
  36. UNSREAD EXEC SEGOV,1
  37. *
  38. *
  39. *
  40. ENTRY SEGFLG
  41. SEGFLG BSS 1
  42. *
  43. *
  44. * /--- BLOCK GETNAME 00 000 80/03/23 06.41
  45. TITLE -GETNAME-
  46. *
  47. *
  48. *
  49. * -GETNAME- BUILD DEFINE NAME
  50. * ON ENTRY - B1 = MAXIMUM NUMBER OF CHARACTERS
  51. * ON RETURN - X6 = LEFT JUSTIFIED NAME
  52. * X1 = TERMINATOR CHARACTER
  53. * X2 = TERMINATOR KEYTYPE
  54. * B1 = CHARACTER COUNT
  55. * B2 = -1 IF COLON ENCOUNTERED
  56. * 0 IF NORMAL DELIMITER
  57. *
  58. ENTRY GETNAME
  59. GETNAM0 SX4 X4-70B CHECK FOR PRECEDING SHIFT
  60. ZR X4,GETNAM2 IF COLON OR DOUBLE QUOTE
  61. *
  62. GETNAME EQ *
  63. SB2 B0 FLAG NO COLON ENCOUNTERED
  64. SB3 B1 GET LIMIT ON LENGTH OF NAME
  65. SA1 WORDPT POINTER TO FIRST CHAR OF NAME
  66. BX7 X1
  67. SB1 B0 CHARACTER COUNT
  68. SB2 54 INITIALIZE SHIFT COUNT
  69. MX6 0 BUILD NAME IN X6
  70. RJ NXTCODE GET FIRST CHAR OF NAME
  71. PL X2,GETNAM0 MAY NOT BE NUMBER OR OP
  72. *
  73. GETNAM1 RJ NXTCODE GET NEXT CHARACTER
  74. PL X3,GETNAM0 EXITWITH TERMINATOR IN X1
  75. LT B3,B1,GNERR ERROR IF TOO MANY CHARACTERS
  76. EQ GETNAM1
  77. *
  78. NXTCODE EQ *
  79. NXTCD1 BX4 X1 SAVE LAST CHARACTER CODE
  80. SA1 X7
  81. SX7 X7+1
  82. SA7 WORDPT ADVANCE / UPDATE POINTER
  83. SX2 X1-1R CODE FOR SPACE
  84. ZR X2,NXTCD1 IGNORE SPACES
  85. SA2 X1+KEYTYPE
  86. SX3 X2-1 SEE IF TERMINATOR (OP)
  87. PL X3,NXTCODE
  88. SB1 B1+1 INCREASE CHAR COUNT
  89. LX0 X1,B2
  90. SB2 B2-6 DECREASE SHIFT COUNT
  91. BX6 X6+X0 ADD TO WORD BUILDING
  92. EQ NXTCODE
  93. *
  94. GETNAM2 BX6 X6-X0 REMOVE SHIFT CODE
  95. SB1 B1-1 DECREMENT CHARACTER COUNT
  96. SB2 -1 FLAG COLON ENCOUNTERED
  97. EQ GETNAME
  98. *
  99. *
  100. GNERR SB1 29 BAD NAME
  101. SA1 =10LBAD NAME
  102. BX7 X1
  103. SA7 CERROR1 STORE MESSAGE
  104. SX7 11 CODE FOR DEFINE ERROR
  105. SA7 TFORMOK
  106. SA3 LOCAL
  107. ZR X3,=XERR IF NOT PROCESING LOCAL SET
  108. *
  109. SA1 DSET
  110. SA1 SETNAMS+X1 X1 = NAME OF CURRENT SET
  111. SA2 KLOCAL X2 = NAME OF LOCAL SET
  112. IX3 X1-X2
  113. ZR X2,=XERR IF LOCAL SET PROCESSING OK
  114. *
  115. MX6 0 NO LOCAL SET IN EFFECT
  116. * /--- BLOCK GETNAME 00 000 80/03/23 06.41
  117. SA6 A3 ZERO LOCAL FLAG
  118. EQ =XERR
  119. *
  120. ENTRY KLOCAL
  121. KLOCAL DATA 00141703011400000000B
  122. *
  123. * /--- BLOCK DEFSUB 00 000 77/01/13 14.27
  124. TITLE -SYMCHK-
  125. *
  126. *
  127. *
  128. * -SYMCHK-
  129. * CHECK IF DEFINED NAME CONFLICTS WITH SYSTEM NAME
  130. *
  131. EXT FCTLIST,LASTFCT,NKLIST,NKLEND,ERRCALL
  132. *
  133. ENTRY SYMCHK
  134. SYMCHK EQ *
  135. SA1 B1 GET DEFINED NAME
  136. BX6 X1
  137. SA6 LASTFCT PLANT FOR END TEST
  138. SA6 NKLEND
  139. SA6 SYMMES1 PLANT FOR ERROR MESSAGE
  140. MX0 42
  141. SB1 1
  142. SA1 FCTLIST-1 INITIALIZE READ REGISTER
  143. *
  144. SYMLP1 SA1 A1+B1 PICK UP NEXT FUNCTION NAME
  145. BX1 X1-X6 SEE IF NAMES MATCH
  146. BX2 X0*X1
  147. NZ X2,SYMLP1 JUMP IF NO MATCH
  148. NG X2,SYMLP1 CHECK FOR -0
  149. SB2 A1
  150. SB3 LASTFCT SEE IF A MATCH WAS FOUND
  151. LT B2,B3,SYMDUP
  152. SA2 LASTFCT GET DEFINED NAME AGAIN
  153. SA1 NKLIST-1
  154. *
  155. SYMLP2 SA1 A1+B1 GET NEXT ENTRY
  156. BX6 X1-X2 COMPARE
  157. BX6 X0*X6 MASK FOR NAME
  158. NZ X6,SYMLP2
  159. SB1 NKLEND CHECK FOR NO MATCH
  160. SB1 A1-B1
  161. NZ B1,SYMDUP
  162. SA1 NLIST-1 INITIALIZE READ REGISTER
  163. *
  164. SYMLP3 SA1 A1+1 LOAD NEXT NAME
  165. ZR X1,SYMCHK EXIT IF END OF LIST
  166. BX1 X1-X2
  167. BX1 X0*X1
  168. NZ X1,SYMLP3 JUMP IF DOES NOT MATCH
  169. *
  170. SYMDUP SB1 95 WARNING ERROR, SYSTEM VARIABLE RE-DEFINED
  171. RJ =XRJERR
  172. EQ SYMCHK
  173. *
  174. *
  175. * EXTRA NAMES NOT RECOGNIZED AS FUNCTIONS, RESERVED
  176. * WORDS OR KEY NAMES
  177. *
  178. NLIST DATA 4LSKIP DRAW 1010;SKIP;2010
  179. DATA 0LBRANCH
  180. DATA 0LDOTO
  181. + VFD 12/7620B,48/0 PI
  182. + VFD 12/7617B,48/0 DEGREE SIGN
  183. DATA 0
  184. *
  185. SYMMES1 DATA 0
  186. *
  187. END
plato/source/plaopl/defsub.txt ยท Last modified: 2023/08/05 18:54 by Site Administrator