12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193 |
- TITLE TVBUG
- .MLLIT==1
- TTYI==1
- TTYO==2
- DSKI==3
- DSKO==4
- CLIO==5
- MAPSIZ==3 ; SIZE OF BLOCK IN LINE MAP
- ; OFFSETS INTO LINE BLOCK IN MAP
- BUF==-2 ; SAVED BYTE POINTER TO ^M TERMINATING LINE
- HP==-1 ; HORIZONTAL POSITION
- CHAR==0 ; # OF CHARACTERS ON LINE
- O=0
- A=1
- B=2
- C=3
- D=4
- E=5
- F=6
- CCT=7 ; COUNT OF CHARACTERS IN BUFFER
- BUFPTR=10 ; BYTE POINTER TO LAST CHARACTER IN BUFFER
- CHPOS=11 ; HPOS ON CURRENT LINE
- CCHARS=12 ; # OF CHARACTERS ON CURRENT LINE
- PREV=13 ; POINTER TO ENTRY IN LINE MAP FOR PREVIOUS LINE--STACK
- P=17
- SUBTTL MACROS
- DEFINE ECHO
- SKIPN JCLMOD
- .CALL ECHOBK
- JFCL
- TERMIN
- ; LOSSAGES
- DEFINE FATINS NAME\
- .VALUE [ASCIZ /: FATAL ERROR -- !NAME!
- /]
- TERMIN
- ; DECREMENT BYTE POINTER
- DEFINE DBP AC
- ADD AC,[70000,,]
- TLNE AC,400000
- ADD AC,[347777,,-1]
- TERMIN
- LOC 40
- 0
- JSR UUOH
- JSR TSINT
- LOC 100
- SUBTTL VARIABLES
- ; CALL BLOCK FOR ECHOING
- ECHOBK: SETZ
- SIXBIT /IOT/
- MOVSI %TJDIS ; SO CONTROL-P WILL BE IGNORED
- MOVEI TTYO
- SETZ A
- PDL: BLOCK 30
- INPBUF: BLOCK 200. ; TTY INPUT BUFFER
- INBLEN: 5*.-5*INPBUF ; # OF CHARACTERS ALLOWABLE
- INPPTR: 440700,,INPBUF
- LINMAP: 440700,,INPBUF ; BYTE POINTER TO START OF INPUT BUFFER
- BLOCK 197. ; LINE MAP UNLESS OVERFLOWS
- MAPLEN: 1+LINMAP-.,,LINMAP ; AOBJN POINTER TO LINE MAP STORAGE
- DBUF: BLOCK 200. ; BUFFER FOR COPYING FILES TO TTY
- DBUFLN==.-DBUF
- DBUFPT: 440700,,DBUF ; BYTE POINTER TO FILE BUFFER
- PDLPTR: -30,,PDL-1 ; INITIAL PDL POINTER
- JCL: BLOCK 20. ; FOR JCL
- PATCH: BLOCK 30. ; PATCH SPACE
- HEADER: ASCIZ /Please describe your bug as completely as possible.
- Terminate with <altmode>. ? will print more information./
- PRMPT: ASCIZ /Message: /
- GCSTOP: MUMBLE ; USED BY CORE ALLOCATOR
- FRETOP: 0
- AGCNUM: 0
- PDLNUM: 0 ; # OF TIMES AGC AND PREV OVERFLOW OCCURRED
- ALLOW: -1 ; IF -1, TRIVIA IS NOT ALREADY DOWN
- MAINT: 0 ; IF XUNAME IS MARC OR TAA
- JCLMOD: 0 ; -1 IF INPUT IS FROM JCL LINE INSTEAD OF TTY
- JCLPTR: 0 ; CONTAINS ILDB POINTER TO JCL IF NEEDED
- XUNAME: 0
- INTALL: 0 ; IF -1, CTRL-S WORKS
- QMODE: 0 ; CTRL-Q TYPED
- TTYOPT: 0
- OPTION: 0 ; FROM SUSET
- LSTERR: 0
- LETRUB: 0 ; IF -1, %TOERS IS ON FOR THIS TTY
- XCTRUB: 0 ; PUSHJ XCT'ED TO DO RUBOUTS
- DSKIOT: .IOT DSKO,A
- DSKUPA: .IOT DSKO,["^]
- TTYIOT: .IOT TTYO,A
- TTYUPA: .IOT TTYO,["^]
- CLIIOT: .IOT CLIO,A
- CLIUPA: .IOT CLIO,["^]
- XCTIOT: 0 ; XCT'ED BY UUO'S
- XCTUPA: 0
- UUOD: 0
- UUOE: 0
- BASE: 0
- HPOS: 0
- CTRLJ: 0 ; PRINT ^M^J FOR CRLF INSTEAD OF JUST ^M
- SUSET: .SIMASK,,[%PIPDL] ; HANDLE PDL OVERFLOW (FOR LINE MAP)
- .RXUNAME,,A ; XUNAME
- .RMEMT,,FRETOP ; HIGH ADDRESS
- .SIMSK2,,[1_TTYI] ; INTERRUPTS FROM TTY
- .ROPTIO,,OPTION ; OPTION WORD (TO SEE IF HAVE JCL)
- .RXJNAME,,C ; XJNAME: TVBUG OR TVUP (AKA FROB)
- SUSETS: SUSET-.,,SUSET
- VERSIO: .FNAM2
-
- START: MOVE P,PDLPTR
- PUSHJ P,TTYOPN
- MOVE O,TTYIOT ; SET UP OUTPUT INSTRUCTIONS FOR UUO'S
- MOVEM O,XCTIOT
- MOVE O,TTYUPA
- MOVEM O,XCTUPA
- SETZM JCLMOD
- SETOM ALLOW
- MOVE B,SUSETS
- .SUSET B
- MOVEM A,XUNAME
- CAME A,[SIXBIT /MARC/] ; FOR SPECIAL HACKS
- CAMN A,[SIXBIT /TAA/]
- JRST [SETOM MAINT
- CAMN C,[SIXBIT /FROB/]
- JRST TVUP ; DELETE DEATH FILES
- PUSHJ P,JCLRED
- JRST STCONT
- JRST KILL]
- PUSHJ P,NJCL ; JCL FOR NORMAL PEOPLE
- JRST STCONT
- JRST STATUS
- TVUP: .CALL [SETZ
- SIXBIT /DELETE/
- [SIXBIT /DSK/]
- [SIXBIT /TRIVIA/]
- [SIXBIT /DEATH/]
- SETZ [SIXBIT /_MSGS_/]]
- JFCL
- .CALL [SETZ
- SIXBIT /DELETE/
- [SIXBIT /DSK/]
- [SIXBIT /TRIVIA/]
- [SIXBIT /CURFEW/]
- SETZ [SIXBIT /_MSGS_/]]
- JFCL
- .CALL [SETZ
- SIXBIT /DELETE/
- [SIXBIT /DSK/]
- [SIXBIT /TRIVIA/]
- [SIXBIT /LOSES/]
- SETZ [SIXBIT /_MSGS_/]]
- .BREAK 16,160000
- .BREAK 16,160000
- STCONT: OASC [ASCIZ /TVBUG./]
- OSIX VERSIO
- OASCR [0]
- STATUS: .CALL [SETZ ; SEE IF TRIVIA DOWN
- SIXBIT /OPEN/
- [.BII,,DSKI]
- [SIXBIT /DSK/]
- [SIXBIT /TRIVIA/]
- [SIXBIT /DEATH/]
- SETZ [SIXBIT /_MSGS_/]] ; IS IT ALREADY DOWN?
- JRST PHEAD
- .CLOSE DSKI,
- SETZM ALLOW ; IF SO, TURKEY CAN'T BRING IT DOWN
- PHEAD: SKIPN JCLMOD ; DON'T PRINT HEADER IF READING FROM JCL
- OASCR HEADER
- ; READER
- READ: SETZ CCT, ; INITIALIZE CHARACTER COUNT
- MOVE BUFPTR,INPPTR ; INITIALIZE BYTE POINTER TO INPUT BUFFER
- SETZB CCHARS,CHPOS
- MOVE PREV,MAPLEN
- ADD PREV,[MAPSIZ-1,,MAPSIZ-1]
- PPRMPT: SKIPN JCLMOD
- OASCR PRMPT ; PRINT PROMPT
- GETCHR: SKIPE JCLMOD
- JRST [ILDB A,JCLPTR ; READ FROM JCL
- JRST PROCHR]
- .IOT TTYI,A ; GET CHAR IN A
- PROCHR: SKIPE QMODE ; QUOTE THIS CHARACTER
- JRST QHACK
- CAIGE A,34
- JRST @CHNDTB(A)
- CAIN A,177 ; RUBOUT
- JRST DORUB
- CAIN A,"? ; MUST BE FIRST CHARACTER TO BE SPECIAL
- JRST DOHELP
- DOECHO: ECHO
- DEPCHR: SETZM QMODE
- DEPCH1: PUSHJ P,GETSIZ ; # OF POSITIONS OCCUPIED BY CHARACTER
- ADD CHPOS,B ; CURRENT HPOS
- ADDI CCHARS,1 ; # OF CHARACTERS ON CURRENT LINE
- ADDI CCT,1 ; TOTAL # OF CHARACTERS IN BUFFER
- CAML CCT,INBLEN ; NUMBER OF SPACES IN INPUT BUFFER
- PUSHJ P,AGC ; GROW THE INPUT BUFFER
- IDPB A,BUFPTR
- JRST GETCHR
- ; DISPATCH TABLE FOR HANDLING OF CONTROL CHARACTERS (0-33)
- CHNDTB: CLRBUF ; CTRL-@: CLEAR BUFFER
- DOECHO
- DOECHO
- CTRLC ; CTRL-C--TERMINATES JCL
- PRTBUF ; CTRL-D
- DOECHO
- DOECHO
- DIE ; CTRL-G
- DOECHO
- DOECHO
- DOECHO ; CTRL-J
- DOECHO
- CLRSCR ; CTRL-L
- CRLFHK ; CTRL-M
- DOECHO
- DOECHO
- DOECHO ; CTRL-P
- QSETUP ; CTRL-Q
- DOECHO
- CLRBUF ; CTRL-S
- DOECHO
- DOECHO
- DOECHO
- WDKILL ; CTRL-W
- LNKILL ; CTRL-X
- DOECHO
- DOECHO
- PTMAIL ; ALTMODE
- SUBTTL SPECIAL READER ROUTINES
- ; HANDLE CARRIAGE RETURN
- CRLFHK: SKIPE JCLMOD ; CARRIAGE RETURN TERMINATES
- JRST PTMAIL
- ECHO
- ADDI CCT,1
- CAML CCT,INBLEN
- PUSHJ P,AGC
- IDPB A,BUFPTR
- PUSH PREV,BUFPTR ; SAVE THIS LINE--LOSS HANDLED AS PDL OVERFLOW
- PUSH PREV,CHPOS
- PUSH PREV,CCHARS
- SETZB CCHARS,CHPOS
- CRLDON: MOVEI A,^J ; PUT ^J IN BUFFER
- JRST DEPCHR
- ; CTRL-Q TYPED
- QSETUP: SETOM QMODE
- ECHO
- JRST GETCHR
- CTRLC: SKIPE JCLMOD
- JRST PTMAIL ; TERMINATE IF IN JCL
- JRST DOECHO ; OTHERWISE TREAT NORMALLY
- ; QUOTE A CHARACTER
- QHACK: SKIPE LETRUB ; ERASE CTRL-Q
- JRST [OCTLP "X
- OCTLP "X
- JRST .+1]
- CAIN A,^M ; CAN'T QUOTE CARRIAGE RETURN
- JRST CRLFHK
- JRST DOECHO
- ; CLEAR SCREEN AND REDISPLAY BUFFER
- CLRSCR: OCTLP "C ; FOR CTRL-L
- JRST RREP
- ; REDISPLAY BUFFER
- PRTBUF: ECHO ; FOR CTRL-D
- OASCR [0]
- RREP: OASCR PRMPT
- PUSHJ P,BUFPRT
- JRST GETCHR
- BUFPRT: PUSH P,A ; PRINT CONTENTS OF INPUT BUFFER
- PUSH P,B
- MOVE A,INPPTR ; POINTER TO BEGINNING OF INPUT
- MOVE B,CCT ; # OF CHARACTERS
- .CALL [SETZ
- SIXBIT /SIOT/
- MOVSI %TJDIS ; SO CTRL-P IS IGNORED
- MOVEI TTYO
- A
- SETZ B]
- .LOSE 1000
- POP P,B
- POP P,A
- POPJ P,
- ; START OVER ON INPUT
- CLRBUF: ECHO
- OASCR [0] ; FOR CTRL-@ AND CTRL-S
- JRST READ
- ; IF ? IS FIRST CHARACTER, PRINT INSTRUCTIONS
- DOHELP: JUMPN CCT,DOECHO
- OASCR HLPMSG
- JRST PPRMPT
- HLPMSG: ASCIZ /Useful characters:
- ?: Prints this, if nothing is in the buffer
- ctrl-@: Clears buffer
- ctrl-D: Redisplays buffer
- ctrl-G: Kills the program
- ctrl-L: Clears screen and redisplays buffer
- ctrl-Q: Quotes next character
- ctrl-S: Stops typeout when printing file
- ctrl-W: Deletes last word in buffer
- ctrl-X: Deletes last line in buffer
- altmode: Terminates message
- rubout: Deletes last character in buffer
- /
- SUBTTL RUBOUT HANDLERS
- ; COME HERE FOR RUBOUTS
- DORUB: PUSHJ P,RUBBER
- JRST READ ; IF NOTHING TO RUBOUT
- JRST GETCHR
- ; COMMON CODE FOR RUBOUTS
- RUBBER: SOJL CCT,CPOPJ
- PUSH P,A
- LDB A,BUFPTR ; VICTIM
- SUBI CCHARS,1
- DBP BUFPTR ; UPDATE BYTE POINTER TO INPUT
- XCT XCTRUB ; TO RUBECH OR RUBFLS, DEPENDING ON %TOERS
- POP P,A
- POPJ1: AOS (P) ; SKIP RETURN IF SOMETHING WAS RUBBED OUT
- CPOPJ: POPJ P,
- ; RUBOUT CODE FOR PRINTING TERMINALS--CRETINOUS
- RUBECH: CAIN A,177 ; ECHO A RUBOUT
- JRST [OASC [ASCIZ /^?/]
- POPJ P,]
- CAIN A,^J
- JRST RECHLF
- RUBEC1: OASCI (A) ; ECHO THE CHARACTER RUBBED OUT
- POPJ P,
- ; RUBOUT A LF
- RECHLF: LDB A,BUFPTR
- CAIN A,^M
- JRST RECHCR
- MOVEI A,^J
- .IOT TTYO,A
- POPJ P,
- ; RUBOUT A CR
- RECHCR: DBP BUFPTR
- SUBI CCT,1
- POP PREV,CCHARS
- POP PREV,CHPOS
- SUB PREV,[1,,1]
- OASCR [0]
- POPJ P,
- ; RUBOUT CODE FOR DISPLAYS
- RUBFLS: CAIN A,177 ; RUBOUT MAY BE TWO POSITIONS
- JRST TSTSAI
- CAIL A,40 ; SPACE (AND ABOVE?) ALWAYS ONE POSITION
- JRST RUBONE
- CAIN A,^I ; TABS REQUIRE SPECIAL HANDLING
- JRST RUBTAB
- CAIN A,^J ; MAY INDICATE CRLF
- JRST RUBLF
- CAIN A,^H ; BECAUSE AOS HORIZONTAL POSITION
- JRST RUBBCK
- CAIN A,^G ; SINCE DOESN'T DISPLAY
- POPJ P,
- TSTSAI: MOVE O,TTYOPT
- TLNE O,%TOSAI
- JRST RUBONE
- CAIN A,177 ; RUBOUT TAKES TWO POSITIONS
- JRST RUBTWO
- CAIN A,33 ; ALTMODE TAKES ONE POSITION
- JRST RUBONE
- RUBTWO: OCTLP "X ; DO THE RUBOUT(S)
- SUBI CHPOS,1
- RUBONE: OCTLP "X
- SUBI CHPOS,1
- POPJ P,
- ; SPECIAL ROUTINES FOR RUBBING OUT RANDOMNESS
- ; RUBOUT BACKSPACE
- RUBBCK: ADDI CHPOS,1
- LDB O,BUFPTR ; ECHO CHARACTER BEFORE BACKSPACE
- .IOT TTYO,O
- POPJ P,
- ; RUBOUT TAB
- RUBTAB: PUSH P,B
- PUSH P,C
- PUSH P,E
- SETZ CHPOS, ; ACCUMULATE HORIZONTAL POSITION IN CHPOS
- JUMPE CCHARS,RTABOT ; IF TAB WAS FIRST ON LINE
- MOVE C,BUF(PREV) ; GET BEGINNING OF THIS LINE
- MOVE E,CCHARS ; # OF CHARACTERS ON THIS LINE
- RTABLP: ILDB A,C
- PUSHJ P,GETSIZ ; SIZE OF CHARACTER
- ADD CHPOS,B
- SOJG E,RTABLP
- RTABOT: OCTLP "H ; ^PH FOLLOWED BY HPOS+8
- MOVEI O,8(CHPOS) ; FOR ABSOLUTE POSITION
- .IOT TTYO,O
- POP P,E
- POP P,C
- POP P,B
- POPJ P,
- ; RUBOUT LINEFEED: EITHER LINESTARVE OR FLUSH CRLF
- RUBLF: LDB A,BUFPTR
- CAIN A,^M ; IS BUFFER ^M^J
- JRST RUBCRL
- OCTLP "U ; DO LINE STARVE
- POPJ P,
- ; RUBOUT CRLF
- RUBCRL: DBP BUFPTR ; GET RID OF ^M
- SUBI CCT,1
- POP PREV,CCHARS ; GET DATA FOR PREVIOUS LINE
- POP PREV,CHPOS
- SUB PREV,[1,,1]
- OCTLP "U ; GO TO PREVIOUS LINE
- OCTLP "H ; GO TO END
- MOVEI A,8(CHPOS)
- .IOT TTYO,A
- POPJ P,
- ; HANDLE CTRL-X: KILL THIS LINE
- LNKILL: MOVE BUFPTR,BUF(PREV)
- MOVE O,PREV
- SUB O,[MAPSIZ-1,,MAPSIZ-1]
- CAME O,MAPLEN ; FIRST LINE
- JRST LNNORM
- SETZB CCT,CCHARS ; SO CLEAR EVERYTHING
- SETZ CHPOS,
- JRST LNMUNG
- LNNORM: IBP BUFPTR ; GET PAST CTRL-J
- SUBI CCT,-1(CCHARS) ; UPDATE CCT
- SETZ CHPOS, ; UPDATE CURRENT LINE
- MOVEI CCHARS,1 ; BECAUSE CTRL-J IS ON LINE
- LNMUNG: SKIPN LETRUB ; IF CAN'T DO %TOERS, JUST ECHO CRLF
- JRST [OASCR [ASCIZ / XXX?/]
- JRST GETCHR]
- OCTLP "H ; GO TO BEGINNING OF LINE
- .IOT TTYO,[8]
- OCTLP "L ; AND KILL TO END
- JRST GETCHR
- ; HANDLE CTRL-W--KILL WORD
- WDKILL: PUSH P,A
- WLOP1: JUMPE CCT,WLEAVE ; FLUSH INVISIBLE CHARACTERS
- LDB A,BUFPTR
- CAIE A,^I
- CAIN A,^J
- JRST WRUB
- CAIE A,40
- CAIN A,^H
- JRST WRUB
- JRST WLOP2
- WRUB: PUSHJ P,RUBBER
- JRST WLEAVE
- JRST WLOP1
- WLOP2: JUMPE CCT,WLEAVE ; THEN FLUSH TO INVISIBLE CHARACTER
- PUSHJ P,RUBBER
- JRST WLEAVE
- LDB A,BUFPTR
- CAIE A,^I
- CAIN A,^J
- JRST WLEAVE
- CAIN A,40
- JRST WLEAVE
- JRST WLOP2
- WLEAVE: POP P,A
- JRST GETCHR
- ; GET SIZE OF CHARACTER. CHAR IN A, SIZE RETURNED IN B.
- GETSIZ: CAIGE A,40
- JRST GETSZ1
- CAIN A,177
- JRST [MOVEI B,2
- MOVE O,TTYOPT
- TLNE B,%TOSAI
- MOVEI B,1
- POPJ P,]
- MOVEI B,1
- POPJ P,
- GETSZ1: MOVE B,TTYOPT
- TLNE B,%TOSAI ; OF %TOSAI, SIZE IS ONE
- JRST [MOVEI B,1
- POPJ P,]
- PUSH P,C
- PUSH P,A
- MOVE C,[000300,,CHRTAB(A)] ; GET DIGIT FROM TABLE
- IDIVI A,14
- IMULI B,-3
- ADDI B,33.
- DPB B,[360600,,C]
- LDB B,C
- CAIG B,4 ; > 4==>CODE TO FIND SIZE
- JRST GETLEV
- JRST @SPCHR-5(B)
- GETLEV: POP P,A
- GETLV1: POP P,C
- POPJ P,
- ; TABLE OF CHARACTER SIZES
- CHRTAB: 222222205602
- 202222222222
- 224122240000
- ; DISPATCH TABLE FOR SPECIAL SIZES
- SPCHR: CTHSIZ
- CTISIZ
- ; BACKSPACE IS -1
- CTHSIZ: SETO B,
- JRST GETLEV
- ; TAB GOES TO NEXT MULTIPLE OF 8
- CTISIZ: MOVE C,CHPOS
- ANDI C,7
- MOVNS C
- MOVEI B,10(C)
- JRST GETLEV
- ; FINISH
- PTMAIL: ECHO ; ECHO THE ALTMODE
- PTMAL1: SETOM INTALL ; COME HERE FROM PTMAIL ROUTINES
- SKIPN ALLOW
- JRST PRINTR
- OASC [ASCIZ /
- Should TRIVIA be brought down? (y,n,?,a,): /]
- .IOT TTYI,A ; READ COMMAND
- ECHO
- CAIE A,"? ; PRINT HELP MESSAGE
- CAIN A,^F
- JRST PRTCOM
- CAIN A,^R ; PRINT MADMAN;TVLOSE >
- JRST PRTFIL
- CAIN A,^L
- JRST [SKIPE LETRUB
- OCTLP "C
- JRST PTMAL1]
- CAIE A,"N ; NOT BROUGHT DOWN
- CAIN A,"n
- JRST PRINTR
- CAIE A,"F
- CAIN A,"f
- JRST PRINTR
- CAIE A,"Y ; BROUGHT DOWN
- CAIN A,"y
- JRST KILL
- CAIE A,"T
- CAIN A,"t
- JRST KILL
- CAIE A,"A ; APPEND TO MESSAGE
- CAIN A,"a
- JRST APPEND
- JRST PTMAL1
- PRTCOM: OASCR [ASCIZ /
- ? prints this
- A allows you to modify your bug description
- Y brings TRIVIA down. If you are not sure whether this should be done,
- read MADMAN;TVLOSE >. Type ctrl-R to have the file printed.
- N sends bug mail, but does not bring TRIVIA down./]
- JRST PTMAL1
- ; PRINT MADMAN;TVLOSE >
- PRTFIL: OASCR [0]
- .CALL [SETZ
- SIXBIT /OPEN/
- [.BII,,DSKI]
- [SIXBIT /DSK/]
- [SIXBIT /TVLOSE/]
- [SIXBIT />/]
- SETZ [SIXBIT /MADMAN/]]
- .LOSE 1000
- .CALL [SETZ
- SIXBIT /FILLEN/
- MOVEI DSKI
- SETZM C]
- .LOSE 1000
- IDIVI C,DBUFLN ; # OF ITERATIONS NEEDED
- JUMPE D,PFLOOP
- ADDI C,1
- PFLOOP: MOVE A,[-DBUFLN,,DBUF]
- .IOT DSKI,A ; IOT IN FIRST PART
- SOJE C,CTCHAK
- MOVEI O,5*DBUFLN
- DOSIOT: MOVE B,DBUFPT
- .CALL [SETZ ; PRINT IT TO TTY
- SIXBIT /SIOT/
- MOVSI %TJDIS
- MOVEI TTYO
- B
- SETZ O]
- .LOSE 1000
- JUMPN C,PFLOOP
- JRST PTMAL1
- CTCHAK: HLRE B,A
- MOVEI O,DBUFLN
- ADD O,B
- IMULI O,5
- MOVEI D,5
- SUBI A,1
- HRLI A,010700
- CTCLOP: LDB B,A
- CAIE B,^C
- CAIN B,0
- CAIA
- JRST DOSIOT
- DBP A
- SUBI O,1
- SOJG D,CTCLOP
- JRST DOSIOT
-
- APPEND: OASC [ASCIZ /
- Append to message:/]
- LDB O,BUFPTR ; IF ALREADY CRLF, DON'T ADD ONE
- CAIN O,^J
- JRST [OASCR [0]
- JRST GETCHR]
- MOVEI A,^M
- SETZM INTALL ; DON'T ALLOW INTERRUPTS
- SETZM JCLMOD ; NOT IN JCL MODE
- JRST CRLFHK
- ; PRINT FILE AND DON'T KILL TRIVIA
- PRINTR: PUSHJ P,PRINT
- .CLOSE DSKO,
- DIE: .BREAK 16,160000
- ; PRINT FILE--TO PRINT1 IF CHANNEL ALREADY OPEN
- PRINT: .CALL [SETZ
- SIXBIT /OPEN/
- [1,,DSKO]
- [SIXBIT /DSK/]
- [SIXBIT /TVLOSS/]
- [SIXBIT />/]
- SETZ [SIXBIT /TAA/]]
- .LOSE 1000
- PRINT1: MOVE O,DSKIOT ; SET UP FOR UUO'
- MOVEM O,XCTIOT
- MOVE O,DSKUPA
- MOVEM O,XCTUPA
- MOVEI C,DSKO ; CHANNEL
- PRINT2: SETOM CTRLJ ; PUSHJ TO HERE TO PRINT ON CLI DEVICE
- OSIX XUNAME ; THE CULPRIT
- OASCI ^I
- PUSHJ P,PDSKDA ; TIME OF LOSSAGE
- OASC [ASCIZ /
- /]
- MOVE A,INPPTR
- MOVE B,CCT
- .CALL [SETZ ; PRINT MESSAGE
- SIXBIT /SIOT/
- C
- A
- SETZ B]
- .LOSE 1000
- MOVE O,TTYIOT
- MOVEM O,XCTIOT
- SETZM CTRLJ
- SKIPN MAINT
- JRST [OASCR [ASCIZ /
- Thank you for your help./]
- PUSHJ P,CLIOUT
- POPJ P,] ; LEAVES CHANNEL OPEN
- POPJ P,
- ; KILL TRIVIA BEFORE PRINTING MESSAGE
- KILL: PUSHJ P,MSGBLS ; MUST BE AT LEAST 10. VISIBLE CHARACTERS
- .BREAK 16,160000
- .CALL [SETZ
- SIXBIT /OPEN/
- [1,,DSKO]
- [SIXBIT /DSK/]
- [SIXBIT /TRIVIA/]
- [SIXBIT /DEATH/]
- SETZ [SIXBIT /_MSGS_/]]
- .LOSE 1000
- MOVE O,XUNAME
- SKIPE MAINT
- JRST [PUSHJ P,PRINT1
- JRST KILFIN]
- .CLOSE DSKO,
- PUSHJ P,PRINT
- SETOM CTRLJ
- MOVE O,DSKIOT
- MOVEM O,XCTIOT
- OASC [ASCIZ /
- TRIVIA brought down./]
- KILFIN: .CLOSE DSKO,
- .BREAK 16,160000
- ; SKIP RETURNS IF > 10 VISIBLE CHARACTERS
- MSGBLS: PUSH P,A
- PUSH P,B
- PUSH P,C
- MOVEI C,10.
- MOVE A,INPPTR
- MOVE B,CCT
- BLSLOP: ILDB O,A
- CAILE O,33 ; VISIBLE?
- CAIN O,40
- JRST BLSEND
- SOJE B,BLSOUT ; IF JUMPS, RAN OUT OF CHARACTERS BEFORE 10 VISIBLE
- SOJG C,BLSLOP
- AOS -3(P) ; FOUND 10, SO SKIP RETURN
- JRST BLSOUT
- BLSEND: SOJG B,BLSLOP
- BLSOUT: POP P,C
- POP P,B
- POP P,A
- POPJ P,
- ; FWEEP TAA HACTRN IF ON-LINE
- CLIOUT: MOVE O,[SIXBIT /TAA/]
- .CALL CLIOPE
- JRST [MOVE O,[SIXBIT /MARC/]
- .CALL CLIOPE
- POPJ P,
- JRST .+1]
- MOVE O,CLIIOT
- MOVEM O,XCTIOT
- MOVE O,CLIUPA
- MOVEM O,XCTUPA
- MOVEI C,CLIO
- SETOM MAINT
- PUSHJ P,PRINT2 ; RESTORES XCTIOT &XCTUPA BEFORE FROBBING
- SETZM MAINT
- .CLOSE CLIO,
- POPJ P,
- CLIOPE: SETZ
- SIXBIT /OPEN/
- [A,,CLIO]
- [SIXBIT /CLI/]
- O
- SETZ [SIXBIT /HACTRN/]
- ;START-UP
- TTYOPN: .CALL [SETZ
- SIXBIT "OPEN"
- [TTYI]
- [SIXBIT "TTY"]
- [SIXBIT "DIRED"]
- [SIXBIT "INTTY"]
- SETZB LSTERR]
- .LOSE 1000
- .CALL [SETZ
- SIXBIT "OPEN"
- [4001,,TTYO] ; display mode == %TIDIS
- [SIXBIT "TTY"]
- [SIXBIT "DIRED"]
- [SIXBIT "OUTTTY"]
- SETZB LSTERR]
- .LOSE 1000
- .CALL [SETZ
- 'CNSGET
- [TTYO]
- MOVEM ; vsize
- MOVEM ; hsize
- MOVEM ; tctyp
- MOVEM ; ttycom
- MOVEM TTYOPT
- SETZB LSTERR]
- .LOSE 1000
- .CALL TTYSET ; SET UP TTY TO TAKE CONTROL CHARACTERS
- .LOSE 1000
- MOVE A,TTYOPT ; SET UP RUBOUT HANDLERS
- MOVE [PUSHJ P,RUBECH]
- TLNE A,%TOERS
- JRST [SETOM LETRUB
- MOVE [PUSHJ P,RUBFLS]
- JRST .+1]
- MOVEM XCTRUB
- POPJ P,
-
- ; SET UP TTY SO EVERYTHING ACTIVATES, ^G AND ^S INTERRUPT
- TTYSET: SETZ
- SIXBIT /TTYSET/
- 1000,,TTYI
- [020202,,020202]
- SETZ [030202,,020202]
- ; FUNNY JCL HACKER. ONLY USED IF MAINT SET--OTHERS GET NJCL
- JCLRED: MOVE A,OPTION
- TLNN A,OPTCMD
- POPJ P, ; NO JCL
- .BREAK 12,[5,,JCL]
- MOVE B,[440700,,JCL]
- ILDB A,B ; GET FIRST CHARACTER
- CAIN A,"' ; ' MEANS THIS IS THE MESSAGE
- JRST JCLMSG
- SUBI A,"0
- MOVE B,CANNED(A)
- HRLI B,440700 ; POINTER TO CANNED MESSAGE INSTEAD
- JCLMSG: MOVEM B,INPPTR ; FOR THE BENEFIT OF THE FILE PRINTER
- SETZM CCT
- JCLOOP: ILDB A,B
- JUMPE A,POPJ1
- CAIN A,^M
- JRST POPJ1
- AOJA CCT,JCLOOP
- ; CANNED MESSAGES
- CANNED: [ASCIZ /TRIVIA down for data-base maintenance. Back very shortly./]
- [ASCIZ /TRIVIA down due to data-base lossage. Have patience./]
- ; JCL HACKER FOR NORMAL PEOPLE: PRETENDS TO BE READING FROM THE TTY
- NJCL: MOVE A,OPTION
- TLNN A,OPTCMD
- POPJ P,
- .BREAK 12,[5,,JCL]
- SETOM JCLMOD
- MOVE A,[440700,,JCL]
- MOVEM A,JCLPTR
- AOS (P)
- POPJ P,
- SUBTTL CORE ALLOCATOR
- ; IBLOCK: TAKES #WORDS IN A, RETURNS POINTER IN A
- IBLOCK: ADD A,GCSTOP ; FIND NEW GCSTOP
- CAML A,FRETOP ; GREATER THAN FRETOP?
- JRST MORCOR ; YES
- EXCH A,GCSTOP ; OLD GCSTOP IS POINTER TO CORE ALLOCATED
- POPJ P,
- ; IF REQUEST BIGGER THAN AVAILABLE CORE, GET PAGE(S)
- MORCOR: PUSH P,B
- PUSH P,A ; SAVE GCSTOP
- SUB A,FRETOP ; # OF NEW WORDS
- ADDI A,2000
- IDIVI A,2000 ; # OF PAGES IS IN A
- PUSH P,A ; SAVE AWAY
- MOVNS A
- MOVE B,FRETOP ; FIND NEW PAGE NUMBER
- LSH B,-12
- HRL B,A ; AOBJN POINTER IN B
- %GETIP: .CALL [SETZ ; FOR HYSTERICAL REASONS
- SIXBIT /CORBLK/
- MOVEI 120000
- [-1]
- B
- SETZI %JSNEW]
- FATINS NO CORE AVAILABLE TO SATISFY REQUEST
- POP P,A ; RECOVER # OF PAGES
- IMULI A,2000 ; ADJUSTMENT TO FRETOP
- ADDM A,FRETOP ; UPDATE FRETOP
- POP P,A ; RESTORE AC'S
- POP P,B
- EXCH A,GCSTOP ; A NOW HAS POINTER TO CORE, GCSTOP UPDATED
- POPJ P,
- SUBTTL INPUT BUFFER EXPANSION
- AGC: PUSH P,A
- PUSH P,B
- PUSH P,C
- AOS AGCNUM
- MOVEI A,500.(CCT) ; SIZE OF NEW BUFFER--500. MORE CHARS
- MOVEM A,INBLEN
- IDIVI A,5
- PUSH P,A
- PUSHJ P,IBLOCK ; GET NEW BUFFER IN A
- MOVE B,INPPTR
- HRLI B,(B) ; ADDRESS OF FIRST WORD OF OLD BUFFER
- HRR B,A
- POP P,C
- ADDI C,-100(A) ; END OF NEW BUFFER
- BLT B,(C) ; MOVE IT OVER
- MOVE B,INPPTR
- SUBI A,(B) ; AMOUNT TO CHANGE ADDRESSES BY
- ADDM A,INPPTR ; UPDATE INPPTR
- ADDM A,BUFPTR ; UPDATE CURRENT BUFFER POINTER
- MOVE B,MAPLEN
- ADD B,[MAPSIZ-1,,MAPSIZ-1]
- AGCLOP: ADDM A,BUF(B) ; UPDATE SAVED BUFFER POINTER
- CAMN B,PREV
- JRST AGCWIN
- ADD B,[MAPSIZ,,MAPSIZ]
- JRST AGCLOP
- AGCWIN: POP P,C
- POP P,B
- POP P,A
- POPJ P,
-
- SUBTTL UUOS
- ; TYPEOUT UUOS (STRAIGHT FROM DIRED, WITH SOME HELP FROM PDL)
- UUOCT==0
- UUOTAB: JRST ILUUO
- IRPS X,,[ODEC OBPTR OHPOS OCTLP OALIGN OSIX OASC OASCI OASCR OSIXS]
- UUOCT==UUOCT+1
- X=UUOCT_33
- JRST U!X
- TERMIN
- UUOMAX==.-UUOTAB
- UUOH: 0
- PUSH P,A
- PUSH P,B
- PUSH P,C
- PUSH P,D
- MOVEI @40 ; GET EFF ADDR. OF UUO
- MOVEM UUOE
- MOVE @0
- MOVEM UUOD ; CONTENTS OF EFF ADR
- MOVE B,UUOE ; EFF ADR
- LDB A,[270400,,40] ; GET UUO AC,
- LDB C,[330600,,40] ; OP CODE
- CAIL C,UUOMAX
- MOVEI C,0 ; GRT=>ILLEGAL
- JRST @UUOTAB(C) ; GO TO PROPER ROUT
- UUORET: POP P,D
- POP P,C
- POP P,B
- POP P,A ; RESTORE AC'S
- JRST 2,@UUOH
- ILUUO: FATINS ILLEGAL UUO
- UOBPTR: MOVEI C,0
- MOVE B,UUOD
- JRST UOASC1
- UOASCR: SKIPA C,[^M] ; CR FOR END OF TYPE
- UOASC: MOVEI C,0 ; NO CR
- HRLI B,440700 ; MAKE ASCII POINTER
- UOASC1: ILDB A,B ; GET CHAR
- JUMPE A,.+3 ; FINISH?
- PUSHJ P,IOTA
- JRST .-3 ; AND GET ANOTHER
- SKIPE A,C ; GET SAVED CR?
- PUSHJ P,IOTA
- JRST UUORET
- UOASCC: HRLI B,440700 ; MAKE ASCII POINTER
- UOAS1C: ILDB A,B ; GET CHAR
- CAIN A,^C
- JRST UUORET
- PUSHJ P,IOTA
- JRST UOAS1C ; AND GET ANOTHER
- UOCTLP: MOVEI A,^P
- PUSHJ P,IOTA1
- UOASCI: MOVE A,B ; PRT ASCII IMMEDIATE
- PUSHJ P,IOTA
- JRST UUORET
- UOSIX: MOVE B,UUOD
- USXOOP: JUMPE B,UUORET
- LDB A,[360600,,B]
- ADDI A,40
- PUSHJ P,IOTA
- LSH B,6
- JRST USXOOP
- UOSIXS: MOVE A,[440600,,UUOD]
- USLOOP: ILDB C,A
- ADDI C,40
- PUSHJ P,IOTC
- TLNE A,770000
- JRST USLOOP
- JRST UUORET
- UOHPOS: SUB B,HPOS
- JUMPLE B,UOASCI
- UOHPO1: MOVEI A,40
- PUSHJ P,IOTA
- SOJG B,UOHPO1
- JRST UUORET
- POWER: 0 ? 1 ? 10. ? 100. ? 1000. ? 10000. ? 100000. ? 1000000.
- UOALIG: MOVE D,UUOD
- ANDI A,7
- MOVE A,POWER(A)
- MOVEI C,40
- UOALI1: CAMLE A,D
- PUSHJ P,IOTC
- IDIVI A,10.
- CAIE A,1
- JRST UOALI1
- SETZ A,
- UODEC: SKIPA C,[10.] ; GET BASE FOR DECIMAL
- UOOCT: MOVEI C,8. ; OCTAL BASE
- MOVE B,UUOD ; GET ACTUAL WORD TO PRT
- JRST .+3 ; JOIN CODE
- UODECI: SKIPA C,[10.] ; DECIMAL
- UOOCTI: MOVEI C,8.
- MOVEM C,BASE
- SKIPN A
- HRREI A,-1 ; A=DIGIT COUNT
- PUSHJ P,UONUM ; PRINT NUMBR
- JRST UUORET
- UONUM: IDIV B,BASE
- HRLM C,(P) ; SAVE DIGIT
- SOJE A,UONUM1 ; DONE IF 0
- SKIPG A ; + => MORE
- SKIPE B ; - => B=0 => DONE
- PUSHJ P,UONUM ; ELSE MORE
- UONUM1: HLRZ C,(P) ; RETREIVE DIGITS
- ADDI C,"0 ; MAKE TO ASCII
- CAILE C,"9 ; IS IT GOOD DIG
- ADDI C,"A-"9-1 ; MAKE HEX DIGIT
- PUSHJ P,IOTC
- POPJ P, ; RET
- IOTC: PUSH P,A
- MOVE A,C
- PUSHJ P,IOTA
- JRST POPAJ
- IOTA: CAIN A,^P
- JRST IOTAP
- IOTA1: SKIPN CTRLJ
- JRST [CAIN A,^J
- POPJ P,
- JRST .+1]
- XCT XCTIOT
- CAIN A,^I
- JRST [MOVE A,HPOS
- ADDI A,10
- ANDI A,7770
- MOVEM A,HPOS
- POPJ P,]
- AOS HPOS
- CAIE A,^M
- POPJ P,
- SETZM HPOS
- POPJ P,
- IOTAP: XCT XCTUPA
- ADDI A,100
- JRST IOTA1
- POPAJ: POP P,A
- POPJ P,
- ; PRINT DISK FORMAT DATE.
- PDSKDA: PUSH P,A
- PUSH P,B
- .CALL [SETZ
- SIXBIT /RQDATE/
- SETZM A]
- .LOSE 1000
- LDB B,[220500,,A] ; GET DAY OF MONTH
- ODEC B
- OASCI 40
- LDB B,[270400,,A] ; GET MONTH
- OASC @MONTHS-1(B)
- OASC [ASCIZ / 19/]
- LDB B,[330700,,A] ; YEAR
- ODEC B
- OASC [ASCIZ / /]
- TLZ A,-1
- ASH A,-1
- IDIVI A,3600. ; # HOURS AFTER MIDNIGHT IN A
- CAIN A,0
- ODEC "0
- ODEC A
- OASCI ":
- MOVE A,B
- IDIVI A,60.
- CAIGE A,10.
- OASCI "0
- ODEC A
- OASCI ":
- CAIGE B,10.
- OASCI "0
- ODEC B
- POP P,B
- POP P,A
- POPJ P,
- MONTHS: [ASCIZ /January/]
- [ASCIZ /February/]
- [ASCIZ /March/]
- [ASCIZ /April/]
- [ASCIZ /May/]
- [ASCIZ /June/]
- [ASCIZ /July/]
- [ASCIZ /August/]
- [ASCIZ /September/]
- [ASCIZ /October/]
- [ASCIZ /November/]
- [ASCIZ /December/]
- ; INTERRUPT HANDLER
- TSINT: 0
- TSINTR: 0
- EXCH A,TSINT
- TLNN A,400000
- JRST TSWD1
- TRNN A,1_TTYI
- JRST TSOUT
- MOVEI A,TTYI
- .ITYIC A,
- JRST TSOUT
- SKIPE QMODE ; CTRL-G KILLS UNLESS JUST TYPED
- JRST TSOUT
- CAIN A,^G
- .BREAK 16,60000
- SKIPN INTALL
- JRST TSOUT
- CAIE A,^S
- JRST TSOUT
- .RESET TTYI,
- MOVE P,PDLPTR
- .IOT TTYO,A
- OASCR [0]
- .DISMIS [PTMAL1]
- TSWD1: TRNN A,%PIPDL ; PDL OVERFLOW
- JRST TSOUT
- PUSH P,A ; P STACK HAS BUFFER
- MOVE A,TSINTR
- LDB A,[270400,,-1(A)] ; GET AC FIELD
- CAIN A,P
- FATINS PDL OVERFLOW ON NON-EXPANDABLE PDL
- PUSH P,B
- PUSH P,C
- AOS PDLNUM ; NUMBER OF TIMES CAME HERE
- HLRE A,MAPLEN ; GET CURRENT LENGTH
- MOVNS A
- PUSH P,A ; AND SAVE IT
- ADDI A,15.*MAPSIZ+1 ; ENOUGH FOR 15 MORE LINES
- PUSHJ P,IBLOCK ; GET SPACE IN A
- MOVE C,A ; AND SAVE IT
- MOVE B,(P) ; GET LENGTH
- ADDI B,(A)
- HRL A,MAPLEN ; SET UP BLT
- BLT A,(B) ; MOVE STACK
- POP P,A
- MOVNS A
- HRLI A,-15.*MAPSIZ(A)
- HRR A,C ; MAKE NEW POINTER
- MOVE B,A
- SUB B,MAPLEN ; GET INCREMENT
- HRLI B,-15.*MAPSIZ ; FIXUP TO PREV
- ADD PREV,B
- MOVEM A,MAPLEN ; FINISH
- POP P,C
- POP P,B
- POP P,A
- TSOUT: EXCH A,TSINT
- .DISMIS TSINTR
- CONSTA
- VARIAB
- MUMBLE==.
- END START
|