tvbug.165 23 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193
  1. TITLE TVBUG
  2. .MLLIT==1
  3. TTYI==1
  4. TTYO==2
  5. DSKI==3
  6. DSKO==4
  7. CLIO==5
  8. MAPSIZ==3 ; SIZE OF BLOCK IN LINE MAP
  9. ; OFFSETS INTO LINE BLOCK IN MAP
  10. BUF==-2 ; SAVED BYTE POINTER TO ^M TERMINATING LINE
  11. HP==-1 ; HORIZONTAL POSITION
  12. CHAR==0 ; # OF CHARACTERS ON LINE
  13. O=0
  14. A=1
  15. B=2
  16. C=3
  17. D=4
  18. E=5
  19. F=6
  20. CCT=7 ; COUNT OF CHARACTERS IN BUFFER
  21. BUFPTR=10 ; BYTE POINTER TO LAST CHARACTER IN BUFFER
  22. CHPOS=11 ; HPOS ON CURRENT LINE
  23. CCHARS=12 ; # OF CHARACTERS ON CURRENT LINE
  24. PREV=13 ; POINTER TO ENTRY IN LINE MAP FOR PREVIOUS LINE--STACK
  25. P=17
  26. SUBTTL MACROS
  27. DEFINE ECHO
  28. SKIPN JCLMOD
  29. .CALL ECHOBK
  30. JFCL
  31. TERMIN
  32. ; LOSSAGES
  33. DEFINE FATINS NAME\
  34. .VALUE [ASCIZ /: FATAL ERROR -- !NAME!
  35. /]
  36. TERMIN
  37. ; DECREMENT BYTE POINTER
  38. DEFINE DBP AC
  39. ADD AC,[70000,,]
  40. TLNE AC,400000
  41. ADD AC,[347777,,-1]
  42. TERMIN
  43. LOC 40
  44. 0
  45. JSR UUOH
  46. JSR TSINT
  47. LOC 100
  48. SUBTTL VARIABLES
  49. ; CALL BLOCK FOR ECHOING
  50. ECHOBK: SETZ
  51. SIXBIT /IOT/
  52. MOVSI %TJDIS ; SO CONTROL-P WILL BE IGNORED
  53. MOVEI TTYO
  54. SETZ A
  55. PDL: BLOCK 30
  56. INPBUF: BLOCK 200. ; TTY INPUT BUFFER
  57. INBLEN: 5*.-5*INPBUF ; # OF CHARACTERS ALLOWABLE
  58. INPPTR: 440700,,INPBUF
  59. LINMAP: 440700,,INPBUF ; BYTE POINTER TO START OF INPUT BUFFER
  60. BLOCK 197. ; LINE MAP UNLESS OVERFLOWS
  61. MAPLEN: 1+LINMAP-.,,LINMAP ; AOBJN POINTER TO LINE MAP STORAGE
  62. DBUF: BLOCK 200. ; BUFFER FOR COPYING FILES TO TTY
  63. DBUFLN==.-DBUF
  64. DBUFPT: 440700,,DBUF ; BYTE POINTER TO FILE BUFFER
  65. PDLPTR: -30,,PDL-1 ; INITIAL PDL POINTER
  66. JCL: BLOCK 20. ; FOR JCL
  67. PATCH: BLOCK 30. ; PATCH SPACE
  68. HEADER: ASCIZ /Please describe your bug as completely as possible.
  69. Terminate with <altmode>. ? will print more information./
  70. PRMPT: ASCIZ /Message: /
  71. GCSTOP: MUMBLE ; USED BY CORE ALLOCATOR
  72. FRETOP: 0
  73. AGCNUM: 0
  74. PDLNUM: 0 ; # OF TIMES AGC AND PREV OVERFLOW OCCURRED
  75. ALLOW: -1 ; IF -1, TRIVIA IS NOT ALREADY DOWN
  76. MAINT: 0 ; IF XUNAME IS MARC OR TAA
  77. JCLMOD: 0 ; -1 IF INPUT IS FROM JCL LINE INSTEAD OF TTY
  78. JCLPTR: 0 ; CONTAINS ILDB POINTER TO JCL IF NEEDED
  79. XUNAME: 0
  80. INTALL: 0 ; IF -1, CTRL-S WORKS
  81. QMODE: 0 ; CTRL-Q TYPED
  82. TTYOPT: 0
  83. OPTION: 0 ; FROM SUSET
  84. LSTERR: 0
  85. LETRUB: 0 ; IF -1, %TOERS IS ON FOR THIS TTY
  86. XCTRUB: 0 ; PUSHJ XCT'ED TO DO RUBOUTS
  87. DSKIOT: .IOT DSKO,A
  88. DSKUPA: .IOT DSKO,["^]
  89. TTYIOT: .IOT TTYO,A
  90. TTYUPA: .IOT TTYO,["^]
  91. CLIIOT: .IOT CLIO,A
  92. CLIUPA: .IOT CLIO,["^]
  93. XCTIOT: 0 ; XCT'ED BY UUO'S
  94. XCTUPA: 0
  95. UUOD: 0
  96. UUOE: 0
  97. BASE: 0
  98. HPOS: 0
  99. CTRLJ: 0 ; PRINT ^M^J FOR CRLF INSTEAD OF JUST ^M
  100. SUSET: .SIMASK,,[%PIPDL] ; HANDLE PDL OVERFLOW (FOR LINE MAP)
  101. .RXUNAME,,A ; XUNAME
  102. .RMEMT,,FRETOP ; HIGH ADDRESS
  103. .SIMSK2,,[1_TTYI] ; INTERRUPTS FROM TTY
  104. .ROPTIO,,OPTION ; OPTION WORD (TO SEE IF HAVE JCL)
  105. .RXJNAME,,C ; XJNAME: TVBUG OR TVUP (AKA FROB)
  106. SUSETS: SUSET-.,,SUSET
  107. VERSIO: .FNAM2
  108. START: MOVE P,PDLPTR
  109. PUSHJ P,TTYOPN
  110. MOVE O,TTYIOT ; SET UP OUTPUT INSTRUCTIONS FOR UUO'S
  111. MOVEM O,XCTIOT
  112. MOVE O,TTYUPA
  113. MOVEM O,XCTUPA
  114. SETZM JCLMOD
  115. SETOM ALLOW
  116. MOVE B,SUSETS
  117. .SUSET B
  118. MOVEM A,XUNAME
  119. CAME A,[SIXBIT /MARC/] ; FOR SPECIAL HACKS
  120. CAMN A,[SIXBIT /TAA/]
  121. JRST [SETOM MAINT
  122. CAMN C,[SIXBIT /FROB/]
  123. JRST TVUP ; DELETE DEATH FILES
  124. PUSHJ P,JCLRED
  125. JRST STCONT
  126. JRST KILL]
  127. PUSHJ P,NJCL ; JCL FOR NORMAL PEOPLE
  128. JRST STCONT
  129. JRST STATUS
  130. TVUP: .CALL [SETZ
  131. SIXBIT /DELETE/
  132. [SIXBIT /DSK/]
  133. [SIXBIT /TRIVIA/]
  134. [SIXBIT /DEATH/]
  135. SETZ [SIXBIT /_MSGS_/]]
  136. JFCL
  137. .CALL [SETZ
  138. SIXBIT /DELETE/
  139. [SIXBIT /DSK/]
  140. [SIXBIT /TRIVIA/]
  141. [SIXBIT /CURFEW/]
  142. SETZ [SIXBIT /_MSGS_/]]
  143. JFCL
  144. .CALL [SETZ
  145. SIXBIT /DELETE/
  146. [SIXBIT /DSK/]
  147. [SIXBIT /TRIVIA/]
  148. [SIXBIT /LOSES/]
  149. SETZ [SIXBIT /_MSGS_/]]
  150. .BREAK 16,160000
  151. .BREAK 16,160000
  152. STCONT: OASC [ASCIZ /TVBUG./]
  153. OSIX VERSIO
  154. OASCR [0]
  155. STATUS: .CALL [SETZ ; SEE IF TRIVIA DOWN
  156. SIXBIT /OPEN/
  157. [.BII,,DSKI]
  158. [SIXBIT /DSK/]
  159. [SIXBIT /TRIVIA/]
  160. [SIXBIT /DEATH/]
  161. SETZ [SIXBIT /_MSGS_/]] ; IS IT ALREADY DOWN?
  162. JRST PHEAD
  163. .CLOSE DSKI,
  164. SETZM ALLOW ; IF SO, TURKEY CAN'T BRING IT DOWN
  165. PHEAD: SKIPN JCLMOD ; DON'T PRINT HEADER IF READING FROM JCL
  166. OASCR HEADER
  167. ; READER
  168. READ: SETZ CCT, ; INITIALIZE CHARACTER COUNT
  169. MOVE BUFPTR,INPPTR ; INITIALIZE BYTE POINTER TO INPUT BUFFER
  170. SETZB CCHARS,CHPOS
  171. MOVE PREV,MAPLEN
  172. ADD PREV,[MAPSIZ-1,,MAPSIZ-1]
  173. PPRMPT: SKIPN JCLMOD
  174. OASCR PRMPT ; PRINT PROMPT
  175. GETCHR: SKIPE JCLMOD
  176. JRST [ILDB A,JCLPTR ; READ FROM JCL
  177. JRST PROCHR]
  178. .IOT TTYI,A ; GET CHAR IN A
  179. PROCHR: SKIPE QMODE ; QUOTE THIS CHARACTER
  180. JRST QHACK
  181. CAIGE A,34
  182. JRST @CHNDTB(A)
  183. CAIN A,177 ; RUBOUT
  184. JRST DORUB
  185. CAIN A,"? ; MUST BE FIRST CHARACTER TO BE SPECIAL
  186. JRST DOHELP
  187. DOECHO: ECHO
  188. DEPCHR: SETZM QMODE
  189. DEPCH1: PUSHJ P,GETSIZ ; # OF POSITIONS OCCUPIED BY CHARACTER
  190. ADD CHPOS,B ; CURRENT HPOS
  191. ADDI CCHARS,1 ; # OF CHARACTERS ON CURRENT LINE
  192. ADDI CCT,1 ; TOTAL # OF CHARACTERS IN BUFFER
  193. CAML CCT,INBLEN ; NUMBER OF SPACES IN INPUT BUFFER
  194. PUSHJ P,AGC ; GROW THE INPUT BUFFER
  195. IDPB A,BUFPTR
  196. JRST GETCHR
  197. ; DISPATCH TABLE FOR HANDLING OF CONTROL CHARACTERS (0-33)
  198. CHNDTB: CLRBUF ; CTRL-@: CLEAR BUFFER
  199. DOECHO
  200. DOECHO
  201. CTRLC ; CTRL-C--TERMINATES JCL
  202. PRTBUF ; CTRL-D
  203. DOECHO
  204. DOECHO
  205. DIE ; CTRL-G
  206. DOECHO
  207. DOECHO
  208. DOECHO ; CTRL-J
  209. DOECHO
  210. CLRSCR ; CTRL-L
  211. CRLFHK ; CTRL-M
  212. DOECHO
  213. DOECHO
  214. DOECHO ; CTRL-P
  215. QSETUP ; CTRL-Q
  216. DOECHO
  217. CLRBUF ; CTRL-S
  218. DOECHO
  219. DOECHO
  220. DOECHO
  221. WDKILL ; CTRL-W
  222. LNKILL ; CTRL-X
  223. DOECHO
  224. DOECHO
  225. PTMAIL ; ALTMODE
  226. SUBTTL SPECIAL READER ROUTINES
  227. ; HANDLE CARRIAGE RETURN
  228. CRLFHK: SKIPE JCLMOD ; CARRIAGE RETURN TERMINATES
  229. JRST PTMAIL
  230. ECHO
  231. ADDI CCT,1
  232. CAML CCT,INBLEN
  233. PUSHJ P,AGC
  234. IDPB A,BUFPTR
  235. PUSH PREV,BUFPTR ; SAVE THIS LINE--LOSS HANDLED AS PDL OVERFLOW
  236. PUSH PREV,CHPOS
  237. PUSH PREV,CCHARS
  238. SETZB CCHARS,CHPOS
  239. CRLDON: MOVEI A,^J ; PUT ^J IN BUFFER
  240. JRST DEPCHR
  241. ; CTRL-Q TYPED
  242. QSETUP: SETOM QMODE
  243. ECHO
  244. JRST GETCHR
  245. CTRLC: SKIPE JCLMOD
  246. JRST PTMAIL ; TERMINATE IF IN JCL
  247. JRST DOECHO ; OTHERWISE TREAT NORMALLY
  248. ; QUOTE A CHARACTER
  249. QHACK: SKIPE LETRUB ; ERASE CTRL-Q
  250. JRST [OCTLP "X
  251. OCTLP "X
  252. JRST .+1]
  253. CAIN A,^M ; CAN'T QUOTE CARRIAGE RETURN
  254. JRST CRLFHK
  255. JRST DOECHO
  256. ; CLEAR SCREEN AND REDISPLAY BUFFER
  257. CLRSCR: OCTLP "C ; FOR CTRL-L
  258. JRST RREP
  259. ; REDISPLAY BUFFER
  260. PRTBUF: ECHO ; FOR CTRL-D
  261. OASCR [0]
  262. RREP: OASCR PRMPT
  263. PUSHJ P,BUFPRT
  264. JRST GETCHR
  265. BUFPRT: PUSH P,A ; PRINT CONTENTS OF INPUT BUFFER
  266. PUSH P,B
  267. MOVE A,INPPTR ; POINTER TO BEGINNING OF INPUT
  268. MOVE B,CCT ; # OF CHARACTERS
  269. .CALL [SETZ
  270. SIXBIT /SIOT/
  271. MOVSI %TJDIS ; SO CTRL-P IS IGNORED
  272. MOVEI TTYO
  273. A
  274. SETZ B]
  275. .LOSE 1000
  276. POP P,B
  277. POP P,A
  278. POPJ P,
  279. ; START OVER ON INPUT
  280. CLRBUF: ECHO
  281. OASCR [0] ; FOR CTRL-@ AND CTRL-S
  282. JRST READ
  283. ; IF ? IS FIRST CHARACTER, PRINT INSTRUCTIONS
  284. DOHELP: JUMPN CCT,DOECHO
  285. OASCR HLPMSG
  286. JRST PPRMPT
  287. HLPMSG: ASCIZ /Useful characters:
  288. ?: Prints this, if nothing is in the buffer
  289. ctrl-@: Clears buffer
  290. ctrl-D: Redisplays buffer
  291. ctrl-G: Kills the program
  292. ctrl-L: Clears screen and redisplays buffer
  293. ctrl-Q: Quotes next character
  294. ctrl-S: Stops typeout when printing file
  295. ctrl-W: Deletes last word in buffer
  296. ctrl-X: Deletes last line in buffer
  297. altmode: Terminates message
  298. rubout: Deletes last character in buffer
  299. /
  300. SUBTTL RUBOUT HANDLERS
  301. ; COME HERE FOR RUBOUTS
  302. DORUB: PUSHJ P,RUBBER
  303. JRST READ ; IF NOTHING TO RUBOUT
  304. JRST GETCHR
  305. ; COMMON CODE FOR RUBOUTS
  306. RUBBER: SOJL CCT,CPOPJ
  307. PUSH P,A
  308. LDB A,BUFPTR ; VICTIM
  309. SUBI CCHARS,1
  310. DBP BUFPTR ; UPDATE BYTE POINTER TO INPUT
  311. XCT XCTRUB ; TO RUBECH OR RUBFLS, DEPENDING ON %TOERS
  312. POP P,A
  313. POPJ1: AOS (P) ; SKIP RETURN IF SOMETHING WAS RUBBED OUT
  314. CPOPJ: POPJ P,
  315. ; RUBOUT CODE FOR PRINTING TERMINALS--CRETINOUS
  316. RUBECH: CAIN A,177 ; ECHO A RUBOUT
  317. JRST [OASC [ASCIZ /^?/]
  318. POPJ P,]
  319. CAIN A,^J
  320. JRST RECHLF
  321. RUBEC1: OASCI (A) ; ECHO THE CHARACTER RUBBED OUT
  322. POPJ P,
  323. ; RUBOUT A LF
  324. RECHLF: LDB A,BUFPTR
  325. CAIN A,^M
  326. JRST RECHCR
  327. MOVEI A,^J
  328. .IOT TTYO,A
  329. POPJ P,
  330. ; RUBOUT A CR
  331. RECHCR: DBP BUFPTR
  332. SUBI CCT,1
  333. POP PREV,CCHARS
  334. POP PREV,CHPOS
  335. SUB PREV,[1,,1]
  336. OASCR [0]
  337. POPJ P,
  338. ; RUBOUT CODE FOR DISPLAYS
  339. RUBFLS: CAIN A,177 ; RUBOUT MAY BE TWO POSITIONS
  340. JRST TSTSAI
  341. CAIL A,40 ; SPACE (AND ABOVE?) ALWAYS ONE POSITION
  342. JRST RUBONE
  343. CAIN A,^I ; TABS REQUIRE SPECIAL HANDLING
  344. JRST RUBTAB
  345. CAIN A,^J ; MAY INDICATE CRLF
  346. JRST RUBLF
  347. CAIN A,^H ; BECAUSE AOS HORIZONTAL POSITION
  348. JRST RUBBCK
  349. CAIN A,^G ; SINCE DOESN'T DISPLAY
  350. POPJ P,
  351. TSTSAI: MOVE O,TTYOPT
  352. TLNE O,%TOSAI
  353. JRST RUBONE
  354. CAIN A,177 ; RUBOUT TAKES TWO POSITIONS
  355. JRST RUBTWO
  356. CAIN A,33 ; ALTMODE TAKES ONE POSITION
  357. JRST RUBONE
  358. RUBTWO: OCTLP "X ; DO THE RUBOUT(S)
  359. SUBI CHPOS,1
  360. RUBONE: OCTLP "X
  361. SUBI CHPOS,1
  362. POPJ P,
  363. ; SPECIAL ROUTINES FOR RUBBING OUT RANDOMNESS
  364. ; RUBOUT BACKSPACE
  365. RUBBCK: ADDI CHPOS,1
  366. LDB O,BUFPTR ; ECHO CHARACTER BEFORE BACKSPACE
  367. .IOT TTYO,O
  368. POPJ P,
  369. ; RUBOUT TAB
  370. RUBTAB: PUSH P,B
  371. PUSH P,C
  372. PUSH P,E
  373. SETZ CHPOS, ; ACCUMULATE HORIZONTAL POSITION IN CHPOS
  374. JUMPE CCHARS,RTABOT ; IF TAB WAS FIRST ON LINE
  375. MOVE C,BUF(PREV) ; GET BEGINNING OF THIS LINE
  376. MOVE E,CCHARS ; # OF CHARACTERS ON THIS LINE
  377. RTABLP: ILDB A,C
  378. PUSHJ P,GETSIZ ; SIZE OF CHARACTER
  379. ADD CHPOS,B
  380. SOJG E,RTABLP
  381. RTABOT: OCTLP "H ; ^PH FOLLOWED BY HPOS+8
  382. MOVEI O,8(CHPOS) ; FOR ABSOLUTE POSITION
  383. .IOT TTYO,O
  384. POP P,E
  385. POP P,C
  386. POP P,B
  387. POPJ P,
  388. ; RUBOUT LINEFEED: EITHER LINESTARVE OR FLUSH CRLF
  389. RUBLF: LDB A,BUFPTR
  390. CAIN A,^M ; IS BUFFER ^M^J
  391. JRST RUBCRL
  392. OCTLP "U ; DO LINE STARVE
  393. POPJ P,
  394. ; RUBOUT CRLF
  395. RUBCRL: DBP BUFPTR ; GET RID OF ^M
  396. SUBI CCT,1
  397. POP PREV,CCHARS ; GET DATA FOR PREVIOUS LINE
  398. POP PREV,CHPOS
  399. SUB PREV,[1,,1]
  400. OCTLP "U ; GO TO PREVIOUS LINE
  401. OCTLP "H ; GO TO END
  402. MOVEI A,8(CHPOS)
  403. .IOT TTYO,A
  404. POPJ P,
  405. ; HANDLE CTRL-X: KILL THIS LINE
  406. LNKILL: MOVE BUFPTR,BUF(PREV)
  407. MOVE O,PREV
  408. SUB O,[MAPSIZ-1,,MAPSIZ-1]
  409. CAME O,MAPLEN ; FIRST LINE
  410. JRST LNNORM
  411. SETZB CCT,CCHARS ; SO CLEAR EVERYTHING
  412. SETZ CHPOS,
  413. JRST LNMUNG
  414. LNNORM: IBP BUFPTR ; GET PAST CTRL-J
  415. SUBI CCT,-1(CCHARS) ; UPDATE CCT
  416. SETZ CHPOS, ; UPDATE CURRENT LINE
  417. MOVEI CCHARS,1 ; BECAUSE CTRL-J IS ON LINE
  418. LNMUNG: SKIPN LETRUB ; IF CAN'T DO %TOERS, JUST ECHO CRLF
  419. JRST [OASCR [ASCIZ / XXX?/]
  420. JRST GETCHR]
  421. OCTLP "H ; GO TO BEGINNING OF LINE
  422. .IOT TTYO,[8]
  423. OCTLP "L ; AND KILL TO END
  424. JRST GETCHR
  425. ; HANDLE CTRL-W--KILL WORD
  426. WDKILL: PUSH P,A
  427. WLOP1: JUMPE CCT,WLEAVE ; FLUSH INVISIBLE CHARACTERS
  428. LDB A,BUFPTR
  429. CAIE A,^I
  430. CAIN A,^J
  431. JRST WRUB
  432. CAIE A,40
  433. CAIN A,^H
  434. JRST WRUB
  435. JRST WLOP2
  436. WRUB: PUSHJ P,RUBBER
  437. JRST WLEAVE
  438. JRST WLOP1
  439. WLOP2: JUMPE CCT,WLEAVE ; THEN FLUSH TO INVISIBLE CHARACTER
  440. PUSHJ P,RUBBER
  441. JRST WLEAVE
  442. LDB A,BUFPTR
  443. CAIE A,^I
  444. CAIN A,^J
  445. JRST WLEAVE
  446. CAIN A,40
  447. JRST WLEAVE
  448. JRST WLOP2
  449. WLEAVE: POP P,A
  450. JRST GETCHR
  451. ; GET SIZE OF CHARACTER. CHAR IN A, SIZE RETURNED IN B.
  452. GETSIZ: CAIGE A,40
  453. JRST GETSZ1
  454. CAIN A,177
  455. JRST [MOVEI B,2
  456. MOVE O,TTYOPT
  457. TLNE B,%TOSAI
  458. MOVEI B,1
  459. POPJ P,]
  460. MOVEI B,1
  461. POPJ P,
  462. GETSZ1: MOVE B,TTYOPT
  463. TLNE B,%TOSAI ; OF %TOSAI, SIZE IS ONE
  464. JRST [MOVEI B,1
  465. POPJ P,]
  466. PUSH P,C
  467. PUSH P,A
  468. MOVE C,[000300,,CHRTAB(A)] ; GET DIGIT FROM TABLE
  469. IDIVI A,14
  470. IMULI B,-3
  471. ADDI B,33.
  472. DPB B,[360600,,C]
  473. LDB B,C
  474. CAIG B,4 ; > 4==>CODE TO FIND SIZE
  475. JRST GETLEV
  476. JRST @SPCHR-5(B)
  477. GETLEV: POP P,A
  478. GETLV1: POP P,C
  479. POPJ P,
  480. ; TABLE OF CHARACTER SIZES
  481. CHRTAB: 222222205602
  482. 202222222222
  483. 224122240000
  484. ; DISPATCH TABLE FOR SPECIAL SIZES
  485. SPCHR: CTHSIZ
  486. CTISIZ
  487. ; BACKSPACE IS -1
  488. CTHSIZ: SETO B,
  489. JRST GETLEV
  490. ; TAB GOES TO NEXT MULTIPLE OF 8
  491. CTISIZ: MOVE C,CHPOS
  492. ANDI C,7
  493. MOVNS C
  494. MOVEI B,10(C)
  495. JRST GETLEV
  496. ; FINISH
  497. PTMAIL: ECHO ; ECHO THE ALTMODE
  498. PTMAL1: SETOM INTALL ; COME HERE FROM PTMAIL ROUTINES
  499. SKIPN ALLOW
  500. JRST PRINTR
  501. OASC [ASCIZ /
  502. Should TRIVIA be brought down? (y,n,?,a,): /]
  503. .IOT TTYI,A ; READ COMMAND
  504. ECHO
  505. CAIE A,"? ; PRINT HELP MESSAGE
  506. CAIN A,^F
  507. JRST PRTCOM
  508. CAIN A,^R ; PRINT MADMAN;TVLOSE >
  509. JRST PRTFIL
  510. CAIN A,^L
  511. JRST [SKIPE LETRUB
  512. OCTLP "C
  513. JRST PTMAL1]
  514. CAIE A,"N ; NOT BROUGHT DOWN
  515. CAIN A,"n
  516. JRST PRINTR
  517. CAIE A,"F
  518. CAIN A,"f
  519. JRST PRINTR
  520. CAIE A,"Y ; BROUGHT DOWN
  521. CAIN A,"y
  522. JRST KILL
  523. CAIE A,"T
  524. CAIN A,"t
  525. JRST KILL
  526. CAIE A,"A ; APPEND TO MESSAGE
  527. CAIN A,"a
  528. JRST APPEND
  529. JRST PTMAL1
  530. PRTCOM: OASCR [ASCIZ /
  531. ? prints this
  532. A allows you to modify your bug description
  533. Y brings TRIVIA down. If you are not sure whether this should be done,
  534. read MADMAN;TVLOSE >. Type ctrl-R to have the file printed.
  535. N sends bug mail, but does not bring TRIVIA down./]
  536. JRST PTMAL1
  537. ; PRINT MADMAN;TVLOSE >
  538. PRTFIL: OASCR [0]
  539. .CALL [SETZ
  540. SIXBIT /OPEN/
  541. [.BII,,DSKI]
  542. [SIXBIT /DSK/]
  543. [SIXBIT /TVLOSE/]
  544. [SIXBIT />/]
  545. SETZ [SIXBIT /MADMAN/]]
  546. .LOSE 1000
  547. .CALL [SETZ
  548. SIXBIT /FILLEN/
  549. MOVEI DSKI
  550. SETZM C]
  551. .LOSE 1000
  552. IDIVI C,DBUFLN ; # OF ITERATIONS NEEDED
  553. JUMPE D,PFLOOP
  554. ADDI C,1
  555. PFLOOP: MOVE A,[-DBUFLN,,DBUF]
  556. .IOT DSKI,A ; IOT IN FIRST PART
  557. SOJE C,CTCHAK
  558. MOVEI O,5*DBUFLN
  559. DOSIOT: MOVE B,DBUFPT
  560. .CALL [SETZ ; PRINT IT TO TTY
  561. SIXBIT /SIOT/
  562. MOVSI %TJDIS
  563. MOVEI TTYO
  564. B
  565. SETZ O]
  566. .LOSE 1000
  567. JUMPN C,PFLOOP
  568. JRST PTMAL1
  569. CTCHAK: HLRE B,A
  570. MOVEI O,DBUFLN
  571. ADD O,B
  572. IMULI O,5
  573. MOVEI D,5
  574. SUBI A,1
  575. HRLI A,010700
  576. CTCLOP: LDB B,A
  577. CAIE B,^C
  578. CAIN B,0
  579. CAIA
  580. JRST DOSIOT
  581. DBP A
  582. SUBI O,1
  583. SOJG D,CTCLOP
  584. JRST DOSIOT
  585. APPEND: OASC [ASCIZ /
  586. Append to message:/]
  587. LDB O,BUFPTR ; IF ALREADY CRLF, DON'T ADD ONE
  588. CAIN O,^J
  589. JRST [OASCR [0]
  590. JRST GETCHR]
  591. MOVEI A,^M
  592. SETZM INTALL ; DON'T ALLOW INTERRUPTS
  593. SETZM JCLMOD ; NOT IN JCL MODE
  594. JRST CRLFHK
  595. ; PRINT FILE AND DON'T KILL TRIVIA
  596. PRINTR: PUSHJ P,PRINT
  597. .CLOSE DSKO,
  598. DIE: .BREAK 16,160000
  599. ; PRINT FILE--TO PRINT1 IF CHANNEL ALREADY OPEN
  600. PRINT: .CALL [SETZ
  601. SIXBIT /OPEN/
  602. [1,,DSKO]
  603. [SIXBIT /DSK/]
  604. [SIXBIT /TVLOSS/]
  605. [SIXBIT />/]
  606. SETZ [SIXBIT /TAA/]]
  607. .LOSE 1000
  608. PRINT1: MOVE O,DSKIOT ; SET UP FOR UUO'
  609. MOVEM O,XCTIOT
  610. MOVE O,DSKUPA
  611. MOVEM O,XCTUPA
  612. MOVEI C,DSKO ; CHANNEL
  613. PRINT2: SETOM CTRLJ ; PUSHJ TO HERE TO PRINT ON CLI DEVICE
  614. OSIX XUNAME ; THE CULPRIT
  615. OASCI ^I
  616. PUSHJ P,PDSKDA ; TIME OF LOSSAGE
  617. OASC [ASCIZ /
  618. /]
  619. MOVE A,INPPTR
  620. MOVE B,CCT
  621. .CALL [SETZ ; PRINT MESSAGE
  622. SIXBIT /SIOT/
  623. C
  624. A
  625. SETZ B]
  626. .LOSE 1000
  627. MOVE O,TTYIOT
  628. MOVEM O,XCTIOT
  629. SETZM CTRLJ
  630. SKIPN MAINT
  631. JRST [OASCR [ASCIZ /
  632. Thank you for your help./]
  633. PUSHJ P,CLIOUT
  634. POPJ P,] ; LEAVES CHANNEL OPEN
  635. POPJ P,
  636. ; KILL TRIVIA BEFORE PRINTING MESSAGE
  637. KILL: PUSHJ P,MSGBLS ; MUST BE AT LEAST 10. VISIBLE CHARACTERS
  638. .BREAK 16,160000
  639. .CALL [SETZ
  640. SIXBIT /OPEN/
  641. [1,,DSKO]
  642. [SIXBIT /DSK/]
  643. [SIXBIT /TRIVIA/]
  644. [SIXBIT /DEATH/]
  645. SETZ [SIXBIT /_MSGS_/]]
  646. .LOSE 1000
  647. MOVE O,XUNAME
  648. SKIPE MAINT
  649. JRST [PUSHJ P,PRINT1
  650. JRST KILFIN]
  651. .CLOSE DSKO,
  652. PUSHJ P,PRINT
  653. SETOM CTRLJ
  654. MOVE O,DSKIOT
  655. MOVEM O,XCTIOT
  656. OASC [ASCIZ /
  657. TRIVIA brought down./]
  658. KILFIN: .CLOSE DSKO,
  659. .BREAK 16,160000
  660. ; SKIP RETURNS IF > 10 VISIBLE CHARACTERS
  661. MSGBLS: PUSH P,A
  662. PUSH P,B
  663. PUSH P,C
  664. MOVEI C,10.
  665. MOVE A,INPPTR
  666. MOVE B,CCT
  667. BLSLOP: ILDB O,A
  668. CAILE O,33 ; VISIBLE?
  669. CAIN O,40
  670. JRST BLSEND
  671. SOJE B,BLSOUT ; IF JUMPS, RAN OUT OF CHARACTERS BEFORE 10 VISIBLE
  672. SOJG C,BLSLOP
  673. AOS -3(P) ; FOUND 10, SO SKIP RETURN
  674. JRST BLSOUT
  675. BLSEND: SOJG B,BLSLOP
  676. BLSOUT: POP P,C
  677. POP P,B
  678. POP P,A
  679. POPJ P,
  680. ; FWEEP TAA HACTRN IF ON-LINE
  681. CLIOUT: MOVE O,[SIXBIT /TAA/]
  682. .CALL CLIOPE
  683. JRST [MOVE O,[SIXBIT /MARC/]
  684. .CALL CLIOPE
  685. POPJ P,
  686. JRST .+1]
  687. MOVE O,CLIIOT
  688. MOVEM O,XCTIOT
  689. MOVE O,CLIUPA
  690. MOVEM O,XCTUPA
  691. MOVEI C,CLIO
  692. SETOM MAINT
  693. PUSHJ P,PRINT2 ; RESTORES XCTIOT &XCTUPA BEFORE FROBBING
  694. SETZM MAINT
  695. .CLOSE CLIO,
  696. POPJ P,
  697. CLIOPE: SETZ
  698. SIXBIT /OPEN/
  699. [A,,CLIO]
  700. [SIXBIT /CLI/]
  701. O
  702. SETZ [SIXBIT /HACTRN/]
  703. ;START-UP
  704. TTYOPN: .CALL [SETZ
  705. SIXBIT "OPEN"
  706. [TTYI]
  707. [SIXBIT "TTY"]
  708. [SIXBIT "DIRED"]
  709. [SIXBIT "INTTY"]
  710. SETZB LSTERR]
  711. .LOSE 1000
  712. .CALL [SETZ
  713. SIXBIT "OPEN"
  714. [4001,,TTYO] ; display mode == %TIDIS
  715. [SIXBIT "TTY"]
  716. [SIXBIT "DIRED"]
  717. [SIXBIT "OUTTTY"]
  718. SETZB LSTERR]
  719. .LOSE 1000
  720. .CALL [SETZ
  721. 'CNSGET
  722. [TTYO]
  723. MOVEM ; vsize
  724. MOVEM ; hsize
  725. MOVEM ; tctyp
  726. MOVEM ; ttycom
  727. MOVEM TTYOPT
  728. SETZB LSTERR]
  729. .LOSE 1000
  730. .CALL TTYSET ; SET UP TTY TO TAKE CONTROL CHARACTERS
  731. .LOSE 1000
  732. MOVE A,TTYOPT ; SET UP RUBOUT HANDLERS
  733. MOVE [PUSHJ P,RUBECH]
  734. TLNE A,%TOERS
  735. JRST [SETOM LETRUB
  736. MOVE [PUSHJ P,RUBFLS]
  737. JRST .+1]
  738. MOVEM XCTRUB
  739. POPJ P,
  740. ; SET UP TTY SO EVERYTHING ACTIVATES, ^G AND ^S INTERRUPT
  741. TTYSET: SETZ
  742. SIXBIT /TTYSET/
  743. 1000,,TTYI
  744. [020202,,020202]
  745. SETZ [030202,,020202]
  746. ; FUNNY JCL HACKER. ONLY USED IF MAINT SET--OTHERS GET NJCL
  747. JCLRED: MOVE A,OPTION
  748. TLNN A,OPTCMD
  749. POPJ P, ; NO JCL
  750. .BREAK 12,[5,,JCL]
  751. MOVE B,[440700,,JCL]
  752. ILDB A,B ; GET FIRST CHARACTER
  753. CAIN A,"' ; ' MEANS THIS IS THE MESSAGE
  754. JRST JCLMSG
  755. SUBI A,"0
  756. MOVE B,CANNED(A)
  757. HRLI B,440700 ; POINTER TO CANNED MESSAGE INSTEAD
  758. JCLMSG: MOVEM B,INPPTR ; FOR THE BENEFIT OF THE FILE PRINTER
  759. SETZM CCT
  760. JCLOOP: ILDB A,B
  761. JUMPE A,POPJ1
  762. CAIN A,^M
  763. JRST POPJ1
  764. AOJA CCT,JCLOOP
  765. ; CANNED MESSAGES
  766. CANNED: [ASCIZ /TRIVIA down for data-base maintenance. Back very shortly./]
  767. [ASCIZ /TRIVIA down due to data-base lossage. Have patience./]
  768. ; JCL HACKER FOR NORMAL PEOPLE: PRETENDS TO BE READING FROM THE TTY
  769. NJCL: MOVE A,OPTION
  770. TLNN A,OPTCMD
  771. POPJ P,
  772. .BREAK 12,[5,,JCL]
  773. SETOM JCLMOD
  774. MOVE A,[440700,,JCL]
  775. MOVEM A,JCLPTR
  776. AOS (P)
  777. POPJ P,
  778. SUBTTL CORE ALLOCATOR
  779. ; IBLOCK: TAKES #WORDS IN A, RETURNS POINTER IN A
  780. IBLOCK: ADD A,GCSTOP ; FIND NEW GCSTOP
  781. CAML A,FRETOP ; GREATER THAN FRETOP?
  782. JRST MORCOR ; YES
  783. EXCH A,GCSTOP ; OLD GCSTOP IS POINTER TO CORE ALLOCATED
  784. POPJ P,
  785. ; IF REQUEST BIGGER THAN AVAILABLE CORE, GET PAGE(S)
  786. MORCOR: PUSH P,B
  787. PUSH P,A ; SAVE GCSTOP
  788. SUB A,FRETOP ; # OF NEW WORDS
  789. ADDI A,2000
  790. IDIVI A,2000 ; # OF PAGES IS IN A
  791. PUSH P,A ; SAVE AWAY
  792. MOVNS A
  793. MOVE B,FRETOP ; FIND NEW PAGE NUMBER
  794. LSH B,-12
  795. HRL B,A ; AOBJN POINTER IN B
  796. %GETIP: .CALL [SETZ ; FOR HYSTERICAL REASONS
  797. SIXBIT /CORBLK/
  798. MOVEI 120000
  799. [-1]
  800. B
  801. SETZI %JSNEW]
  802. FATINS NO CORE AVAILABLE TO SATISFY REQUEST
  803. POP P,A ; RECOVER # OF PAGES
  804. IMULI A,2000 ; ADJUSTMENT TO FRETOP
  805. ADDM A,FRETOP ; UPDATE FRETOP
  806. POP P,A ; RESTORE AC'S
  807. POP P,B
  808. EXCH A,GCSTOP ; A NOW HAS POINTER TO CORE, GCSTOP UPDATED
  809. POPJ P,
  810. SUBTTL INPUT BUFFER EXPANSION
  811. AGC: PUSH P,A
  812. PUSH P,B
  813. PUSH P,C
  814. AOS AGCNUM
  815. MOVEI A,500.(CCT) ; SIZE OF NEW BUFFER--500. MORE CHARS
  816. MOVEM A,INBLEN
  817. IDIVI A,5
  818. PUSH P,A
  819. PUSHJ P,IBLOCK ; GET NEW BUFFER IN A
  820. MOVE B,INPPTR
  821. HRLI B,(B) ; ADDRESS OF FIRST WORD OF OLD BUFFER
  822. HRR B,A
  823. POP P,C
  824. ADDI C,-100(A) ; END OF NEW BUFFER
  825. BLT B,(C) ; MOVE IT OVER
  826. MOVE B,INPPTR
  827. SUBI A,(B) ; AMOUNT TO CHANGE ADDRESSES BY
  828. ADDM A,INPPTR ; UPDATE INPPTR
  829. ADDM A,BUFPTR ; UPDATE CURRENT BUFFER POINTER
  830. MOVE B,MAPLEN
  831. ADD B,[MAPSIZ-1,,MAPSIZ-1]
  832. AGCLOP: ADDM A,BUF(B) ; UPDATE SAVED BUFFER POINTER
  833. CAMN B,PREV
  834. JRST AGCWIN
  835. ADD B,[MAPSIZ,,MAPSIZ]
  836. JRST AGCLOP
  837. AGCWIN: POP P,C
  838. POP P,B
  839. POP P,A
  840. POPJ P,
  841. SUBTTL UUOS
  842. ; TYPEOUT UUOS (STRAIGHT FROM DIRED, WITH SOME HELP FROM PDL)
  843. UUOCT==0
  844. UUOTAB: JRST ILUUO
  845. IRPS X,,[ODEC OBPTR OHPOS OCTLP OALIGN OSIX OASC OASCI OASCR OSIXS]
  846. UUOCT==UUOCT+1
  847. X=UUOCT_33
  848. JRST U!X
  849. TERMIN
  850. UUOMAX==.-UUOTAB
  851. UUOH: 0
  852. PUSH P,A
  853. PUSH P,B
  854. PUSH P,C
  855. PUSH P,D
  856. MOVEI @40 ; GET EFF ADDR. OF UUO
  857. MOVEM UUOE
  858. MOVE @0
  859. MOVEM UUOD ; CONTENTS OF EFF ADR
  860. MOVE B,UUOE ; EFF ADR
  861. LDB A,[270400,,40] ; GET UUO AC,
  862. LDB C,[330600,,40] ; OP CODE
  863. CAIL C,UUOMAX
  864. MOVEI C,0 ; GRT=>ILLEGAL
  865. JRST @UUOTAB(C) ; GO TO PROPER ROUT
  866. UUORET: POP P,D
  867. POP P,C
  868. POP P,B
  869. POP P,A ; RESTORE AC'S
  870. JRST 2,@UUOH
  871. ILUUO: FATINS ILLEGAL UUO
  872. UOBPTR: MOVEI C,0
  873. MOVE B,UUOD
  874. JRST UOASC1
  875. UOASCR: SKIPA C,[^M] ; CR FOR END OF TYPE
  876. UOASC: MOVEI C,0 ; NO CR
  877. HRLI B,440700 ; MAKE ASCII POINTER
  878. UOASC1: ILDB A,B ; GET CHAR
  879. JUMPE A,.+3 ; FINISH?
  880. PUSHJ P,IOTA
  881. JRST .-3 ; AND GET ANOTHER
  882. SKIPE A,C ; GET SAVED CR?
  883. PUSHJ P,IOTA
  884. JRST UUORET
  885. UOASCC: HRLI B,440700 ; MAKE ASCII POINTER
  886. UOAS1C: ILDB A,B ; GET CHAR
  887. CAIN A,^C
  888. JRST UUORET
  889. PUSHJ P,IOTA
  890. JRST UOAS1C ; AND GET ANOTHER
  891. UOCTLP: MOVEI A,^P
  892. PUSHJ P,IOTA1
  893. UOASCI: MOVE A,B ; PRT ASCII IMMEDIATE
  894. PUSHJ P,IOTA
  895. JRST UUORET
  896. UOSIX: MOVE B,UUOD
  897. USXOOP: JUMPE B,UUORET
  898. LDB A,[360600,,B]
  899. ADDI A,40
  900. PUSHJ P,IOTA
  901. LSH B,6
  902. JRST USXOOP
  903. UOSIXS: MOVE A,[440600,,UUOD]
  904. USLOOP: ILDB C,A
  905. ADDI C,40
  906. PUSHJ P,IOTC
  907. TLNE A,770000
  908. JRST USLOOP
  909. JRST UUORET
  910. UOHPOS: SUB B,HPOS
  911. JUMPLE B,UOASCI
  912. UOHPO1: MOVEI A,40
  913. PUSHJ P,IOTA
  914. SOJG B,UOHPO1
  915. JRST UUORET
  916. POWER: 0 ? 1 ? 10. ? 100. ? 1000. ? 10000. ? 100000. ? 1000000.
  917. UOALIG: MOVE D,UUOD
  918. ANDI A,7
  919. MOVE A,POWER(A)
  920. MOVEI C,40
  921. UOALI1: CAMLE A,D
  922. PUSHJ P,IOTC
  923. IDIVI A,10.
  924. CAIE A,1
  925. JRST UOALI1
  926. SETZ A,
  927. UODEC: SKIPA C,[10.] ; GET BASE FOR DECIMAL
  928. UOOCT: MOVEI C,8. ; OCTAL BASE
  929. MOVE B,UUOD ; GET ACTUAL WORD TO PRT
  930. JRST .+3 ; JOIN CODE
  931. UODECI: SKIPA C,[10.] ; DECIMAL
  932. UOOCTI: MOVEI C,8.
  933. MOVEM C,BASE
  934. SKIPN A
  935. HRREI A,-1 ; A=DIGIT COUNT
  936. PUSHJ P,UONUM ; PRINT NUMBR
  937. JRST UUORET
  938. UONUM: IDIV B,BASE
  939. HRLM C,(P) ; SAVE DIGIT
  940. SOJE A,UONUM1 ; DONE IF 0
  941. SKIPG A ; + => MORE
  942. SKIPE B ; - => B=0 => DONE
  943. PUSHJ P,UONUM ; ELSE MORE
  944. UONUM1: HLRZ C,(P) ; RETREIVE DIGITS
  945. ADDI C,"0 ; MAKE TO ASCII
  946. CAILE C,"9 ; IS IT GOOD DIG
  947. ADDI C,"A-"9-1 ; MAKE HEX DIGIT
  948. PUSHJ P,IOTC
  949. POPJ P, ; RET
  950. IOTC: PUSH P,A
  951. MOVE A,C
  952. PUSHJ P,IOTA
  953. JRST POPAJ
  954. IOTA: CAIN A,^P
  955. JRST IOTAP
  956. IOTA1: SKIPN CTRLJ
  957. JRST [CAIN A,^J
  958. POPJ P,
  959. JRST .+1]
  960. XCT XCTIOT
  961. CAIN A,^I
  962. JRST [MOVE A,HPOS
  963. ADDI A,10
  964. ANDI A,7770
  965. MOVEM A,HPOS
  966. POPJ P,]
  967. AOS HPOS
  968. CAIE A,^M
  969. POPJ P,
  970. SETZM HPOS
  971. POPJ P,
  972. IOTAP: XCT XCTUPA
  973. ADDI A,100
  974. JRST IOTA1
  975. POPAJ: POP P,A
  976. POPJ P,
  977. ; PRINT DISK FORMAT DATE.
  978. PDSKDA: PUSH P,A
  979. PUSH P,B
  980. .CALL [SETZ
  981. SIXBIT /RQDATE/
  982. SETZM A]
  983. .LOSE 1000
  984. LDB B,[220500,,A] ; GET DAY OF MONTH
  985. ODEC B
  986. OASCI 40
  987. LDB B,[270400,,A] ; GET MONTH
  988. OASC @MONTHS-1(B)
  989. OASC [ASCIZ / 19/]
  990. LDB B,[330700,,A] ; YEAR
  991. ODEC B
  992. OASC [ASCIZ / /]
  993. TLZ A,-1
  994. ASH A,-1
  995. IDIVI A,3600. ; # HOURS AFTER MIDNIGHT IN A
  996. CAIN A,0
  997. ODEC "0
  998. ODEC A
  999. OASCI ":
  1000. MOVE A,B
  1001. IDIVI A,60.
  1002. CAIGE A,10.
  1003. OASCI "0
  1004. ODEC A
  1005. OASCI ":
  1006. CAIGE B,10.
  1007. OASCI "0
  1008. ODEC B
  1009. POP P,B
  1010. POP P,A
  1011. POPJ P,
  1012. MONTHS: [ASCIZ /January/]
  1013. [ASCIZ /February/]
  1014. [ASCIZ /March/]
  1015. [ASCIZ /April/]
  1016. [ASCIZ /May/]
  1017. [ASCIZ /June/]
  1018. [ASCIZ /July/]
  1019. [ASCIZ /August/]
  1020. [ASCIZ /September/]
  1021. [ASCIZ /October/]
  1022. [ASCIZ /November/]
  1023. [ASCIZ /December/]
  1024. ; INTERRUPT HANDLER
  1025. TSINT: 0
  1026. TSINTR: 0
  1027. EXCH A,TSINT
  1028. TLNN A,400000
  1029. JRST TSWD1
  1030. TRNN A,1_TTYI
  1031. JRST TSOUT
  1032. MOVEI A,TTYI
  1033. .ITYIC A,
  1034. JRST TSOUT
  1035. SKIPE QMODE ; CTRL-G KILLS UNLESS  JUST TYPED
  1036. JRST TSOUT
  1037. CAIN A,^G
  1038. .BREAK 16,60000
  1039. SKIPN INTALL
  1040. JRST TSOUT
  1041. CAIE A,^S
  1042. JRST TSOUT
  1043. .RESET TTYI,
  1044. MOVE P,PDLPTR
  1045. .IOT TTYO,A
  1046. OASCR [0]
  1047. .DISMIS [PTMAL1]
  1048. TSWD1: TRNN A,%PIPDL ; PDL OVERFLOW
  1049. JRST TSOUT
  1050. PUSH P,A ; P STACK HAS BUFFER
  1051. MOVE A,TSINTR
  1052. LDB A,[270400,,-1(A)] ; GET AC FIELD
  1053. CAIN A,P
  1054. FATINS PDL OVERFLOW ON NON-EXPANDABLE PDL
  1055. PUSH P,B
  1056. PUSH P,C
  1057. AOS PDLNUM ; NUMBER OF TIMES CAME HERE
  1058. HLRE A,MAPLEN ; GET CURRENT LENGTH
  1059. MOVNS A
  1060. PUSH P,A ; AND SAVE IT
  1061. ADDI A,15.*MAPSIZ+1 ; ENOUGH FOR 15 MORE LINES
  1062. PUSHJ P,IBLOCK ; GET SPACE IN A
  1063. MOVE C,A ; AND SAVE IT
  1064. MOVE B,(P) ; GET LENGTH
  1065. ADDI B,(A)
  1066. HRL A,MAPLEN ; SET UP BLT
  1067. BLT A,(B) ; MOVE STACK
  1068. POP P,A
  1069. MOVNS A
  1070. HRLI A,-15.*MAPSIZ(A)
  1071. HRR A,C ; MAKE NEW POINTER
  1072. MOVE B,A
  1073. SUB B,MAPLEN ; GET INCREMENT
  1074. HRLI B,-15.*MAPSIZ ; FIXUP TO PREV
  1075. ADD PREV,B
  1076. MOVEM A,MAPLEN ; FINISH
  1077. POP P,C
  1078. POP P,B
  1079. POP P,A
  1080. TSOUT: EXCH A,TSINT
  1081. .DISMIS TSINTR
  1082. CONSTA
  1083. VARIAB
  1084. MUMBLE==.
  1085. END START