1 / SPEAK - Types out messages from the database
2 / Also includes TTY output routines that unpack
3 / packed sixbit into mixed case ASCII.
7 TTY, 0 / TTY Output routine, dupe of FRTS
8 IOF / Protect from race conditions
10 JMP KBD / Input - read character
11 DCA HANGPT / Output - save char
16 TAD% TOCHR / Output character status in FRTS
17 SMA SZA CLA / If gt 0, char backed up
18 JMP BUSY / Else must wait
19 LOOP, TAD% TOCHR / Get the status
20 CLL RAL /Busy flag in link
21 CLA CML RAR /Complement of busy in sign
25 DCA% TOCHR /Store pos or neg, backed up or busy
26 TTYRET, ION /Interrupts back on
27 CDFX, HLT /Caller's field
32 BUSY, CDF 10 /Busy, must wait. Call Field 0 HANG routine
37 JMP LOOP / Try output again
43 TAD% TICHR / Any input?
46 GETIN, TAD% TICHR / Get character
48 DCA% TICHR / Clear buffer
62 / Terminal line input routine. Used because the FRTS input is quite limited.
63 / This one handles scope rubouts and allows lower case input.
64 / Inputs: Array Returned characters, stored one sixbit per array word
65 / (The FORTRAN input routine is set up this way to unpack)
66 / Size Number of characters to allow
67 / Prompt Prompt string
102 / Pass down size to '8' code
106 FNEG / Make it negative
107 ATX 0 / Pass buffer len
109 TRAP4 GETLIN / Get input line
110 JA #RLRTN / And return
117 DCA OFFSET / Start at offset zero
121 TAD% BUFFLD+1 / Get CDF for buffer
128 / Go get an input character
130 GETNXT, JMS% PTTY+1 / Called with zero to get char
131 DCA INCH / Save input
138 JMP DELETE / Handle that
142 JMP ENTER / End of line, let's go.
144 TAD MSPC / Less than space?
146 JMP BELL / Nope, ignore
148 TAD BUFSIZ / Room left?
150 JMP BELL / Bell if not
152 JMS% PTTY+1 / Echo it
154 TAD LWRA / Is it lowercase?
156 JMP UPPER / No, store it
160 JMP UPPER / More than lowercase z
162 TAD AMINA / Adjust to uppercase
164 UPPER, JMS STORE / Store this character
165 JMP GETNXT / Get more
166 / Store a character in the output buffer
167 / using the current offset
173 TAD OFFSET / Count FPP words
174 TAD% BUFPTR+1 / Pointer to exponent word
176 TAD K27 / Exponent 27 for integer
178 JMS STO / Zero high word
179 TAD INCH / Char value
180 AND SIXMSK / Convert to sixbit
181 JMS STO / Store in buffer
182 CDF 10 / Back to my field
183 ISZ OFFSET / One more in the buffer
184 SPC, 240 / Really shouldn't overflow; harmless AND
187 BUFCDF, HLT / Gets CDF for buffer field
190 JMP% STO / Return if no skip
196 BELL, TAD BEL / Warn the user
200 DELETE, TAD OFFSET / How far into the buffer are we?
202 JMP BELL / Ignore extra deletes
205 JMP DUMBDL / Simple fortran-format delete
212 JMP FIXOFF / Fix the offset
213 DUMBDL, TAD K334 / Backslash
220 ENTER, TAD CR / Send a RETURN
222 CLRLP, TAD OFFSET / Is there space available?
234 SCOPT, 7726 / Scope flag in OS/8
243 AMINA, -40 / Add to "a" to make "A"
259 / Fortran-callable message printer
260 / Put here to avoid wasting the rest of the page.
263 / COUNT Number of characters to write, zero to look for end
264 / CRFLAG Carriage return flags.
265 / Bit 11 (1) = no lead LF
266 / Bit 10 (2) = no trail CR
267 / Bit 9 (4) = start lowercase
296 FSTA BUF / Buffer pointer
297 FLDA% #SBASE,1+ / Count
299 FLDA% #SBASE,1+ / Carriage control flag
308 TRAP4 SIX8 /Call the 8-mode output routine
312 ENTRY SIX8 / Mixed case output routine
315 TAD CRFLAG /Suppresss carriage control?
316 RAR /Low bit suppresses lead LF
318 JMP .+4 /No leading LF
321 JMS% TTYPTR+1 /Output it
323 AND K4 /Start in lower case?
326 TAD HUN /Reset conversion factor
328 TAD BUF /Buffer field
329 AND K7 /Just the field bits
332 TAD CDF0 /Into CDF instruction
336 TAD COUNT /Get buffer length
338 JMP NOTRIM /Zero means it has a terminating "@"
340 / Find the end of the string
342 CLA CMA /End is start + len - 1
343 TAD COUNT /String len in words
344 TAD BUF+1 /End of the string
345 DCA PTR /Pointer to end
346 TAD COUNT /Invert count
351 TAD K3740 / - ' ' (two spaces)
352 SZA CLA / Skip if blank
354 ISZ COUNT /Count another
356 JMP NONBLK /If empty, done
359 DCA PTR /Back pointer up
360 JMP FNDEND /Keep looking
363 SNA CLA /Skip if output left
364 JMP DONE /Nothing if count zero already
365 NOTRIM, TAD BUF+1 /Reset pointer to start
374 JMS OUTONE /Convert and output it
375 TAD STEMP /Second sixbit
377 ISZ PTR /Bump pointer
379 JMP NEWFLD /Next field otherwise
381 JMP CDF2 /Keep outputting
383 TAD CRFLAG /Suppress trailing CR?
384 RTR /2 bit suppresses trailing CR
385 SZL CLA /If zero, write it.
386 JMP OUT /Yes, leave now
403 JMP DONE / End of string
404 TAD K7743 / minus '['
406 JMP SETLWR /Set to lowercase shift
409 JMP SETUPR /Set to uppercase
412 TAD SHIFT /For positive, shift it
413 TAD K40 /Else it's not alphabetic
415 JMS% TTYPTR+1 /Output it
418 SETLWR, TAD K40 /Reset shift
419 SETUPR, TAD HUN /For upper/lower
424 SHIFT, 140 /Shift value
425 / COUNT and CRFLAG must stay together
426 COUNT, 0 /Num words to output.
427 CRFLAG, 0 /1 - no leading LF, 2 no trailing CR
431 K3740, 3740 /minus blank
432 BUF, 0;0;0 /Buffer 15-bit address
442 K10, 10 /Field increment
447 / SUBROUTINE SPEAK(N)
449 /C PRINT THE MESSAGE IN RECORD N OF THE RANDOM ACCESS MESSAGE FILE.
451 / IMPLICIT INTEGER (A-Z)
452 / COMMON /TXTCOM/ RTEXT,LINES,ASCVAR
453 / COMMON /ALPHAS/ BLANK,EOF
454 / DIMENSION RTEXT(205),LINES(36)
503 / READ(2'N) LOC,LINES
511 / IF(LINES(1).EQ.EOF)RETURN
524 / Set COUNT to the number of words (36 or 44 octal)
527 LDX 0,1 /With carriage control
531 /5 TYPE 2,(LINES(I),I=1,L)
533 FSTA BUF /Set buffer pointer
540 / READ(2'ASCVAR) LOC,LINES
547 / IF(LOC .EQ. OLDLOC) GO TO 1
563 /2 FORMAT(' ',36A2) PDP/8: (' ',12A6)