Trailing-Edge
-
PDP-10 Archives
-
decuslib10-02
-
43,50213/lptque.doc
There are 2 other files named lptque.doc in the archive. Click here to see a list.
1
/*** LPTQUE.PAL, APRIL 14, 1970*****
/
/
/
/ PETER LEMKIN
/ NATIONAL INSTITUTES OF HEALTH
/ BETHESDA, MD. 20014
/
/
/INTRODUCTION
/------------
/"LPTQUE" IS A PDP8 UTILITY PROGRAM WHICH IS USED TO BUFFER ASCII
/INPUT FROM A PT08 SERIAL TO PARALLEL INTERFACE ONTO AN A.B. DICK
/940 (USING THE ECLECTIC COMPUTER COMPANY'S INTERFACE) LINEPRINTER.
/THE ASR33 TELETYPE CAN BE USED TO SEND COMMANDS TO A COMPUTER
/ON THE OTHER END OF THE PT08 ( WHICH IN TURN IS SENDING INFORMATION TO
/THE PDP8 TO BE PRINTED ON THE LINEPRINTER.).
/I.E. PDP8'S ASR33 TTY ==> PT08 ==>PDP10
/ PDP8'S 940 LPT <=== PT08 <== PDP10.
/
/
/MINIMUM HARDWARE:
/------------------
/PDP8 WITH PT08, 4K MEMORY, AND A.B. DICK 940 LINEPRINTER
/WITH ECLECTIC COMPUTER COMPANY INTERFACE TO PDP8. TO RUN "LPTQUE"
/IN ANOTHER FIELD, SET DATFLD=10 TIMES THE DESIRED FIELD. IE.E 00, 10
/ETC. THEN REASSEMBLE "LPTQUE". "LPTQUE" WAS ASSEMBLED USING PAL10 ON A
/PDP10.
/
/
/CORE REQUIREMENTS AND STARTING ADDRESS:
/--------------------------------------
/ <200,577> PROGRAM
/ <600,4577> LPT BUFFER.
/ STARTING ADDRESS IS 200
/
/
/
/ERROR CONDITION:
/---------------
/NOTE: ALTHOUGH THE 940 LINEPRINTER CAN PRINT AT 2400 BAUD, ITS
/EFFECTIVE DATA RATE IS A FUNCTION OF LENGTH OF THE LINE PRINTED.
/FOR SHORT LINES, THIS CAN GO BELOW 1200 BAUD. THEREFORE IF YOU
/ARE USING A 1200 BAUD LINE (AS WE ARE), OCCASIONALLY YOU WILL OVERFLOW
/THE LPT BUFFER DUE TO PTHE FACT THAT YOU ARE ACCUMULATING DATA FASTER THAN
/YOU CAN PRINT IT. WHEN THIS HAPPENS, THE PROGRAM HALTS. TO RESTART IT
/DO A LOAD ADDRESS-START 200.
/NOTE: THE NUMBER OF LINES IN THE BUFFER QUEUE WAITING TO BE PRINTED
/ARE DISPLAYED IN THE MQ REGISTER. IF YOU DO NOT HAVE EAE, THIS IS A NOP.
/
/
/PROBLEMS:
/-------
/TABS AND FORM FEEDS ARE NOT IMPLEMENTED.
/
2
/
/
/
/
/
/
/PT08 OP CODES
6411 PTSF=6411
6401 PKSF=6401
6416 PTLS=6416
6406 PKRB=6406
6412 PTCF=6412
/AB DICK 940 LINEPRINTER OP CODES
6656 LTLS=6656
6651 LTSF=6651
6652 LTCF=6652
/LPT BUFFER MIN AND MAX POINTERS: MAY BE CHANGED BEFORE ASSEMBLE.
0601 TQMIN=601
4577 TQMAX=4577
/FIELD DEFINITION - I.E. RUNNING FIELDS.
0000 DATFLD=00
0000 INSTFD=DATFLD
/
/
/
/
/
0000 FIELD INSTFD
0200 *200
/MONITOR LOOP
0200 7200 CLA /DISABLE THE EMB
0201 1377 TAD (-62 /SET LINE COUNTER
0202 3350 DCA LINCNT
0203 3347 DCA EMB
0204 3346 DCA BUFCTR /ZERO THE BUFFER COUNTER
0205 6656 LTLS /START IT UP
0206 4776' START, JMS INITQU /INIT QUEUE
0207 4775' JMS INITBF
0210 6031 INPUT, KSF /TTY? IF SO TYPE IT AND SEND TO PDP10.
0211 5215 JMP .+4 /NO
0212 6036 KRB
0213 6046 TLS
0214 6416 PTLS /SEND TO PDP10 SO AND TELL IT OFF.
0215 1374 TAD (-215 /IS IT CR?
0216 7640 SZA CLA
0217 5224 JMP .+5 /NO
0220 1373 TAD (212 /PRINT A LINE FEED
0221 6041 TSF
0222 5221 JMP .-1
0223 6046 TLS
0224 7200 CLA /PUT THE # OF BUFFERS IN THE MQ
0225 1346 TAD BUFCTR
7421 MQL=7421
0226 7421 MQL
0227 6401 PKSF /INPUT?
3
0230 7410 SKP
0231 5234 JMP .+3
0232 4314 JMS OUTPUT /NO, CHECK OUTPUT
0233 5210 JMP INPUT
0234 6406 PKRB
0235 0372 AND (177
0236 1371 TAD (200
0237 3351 DCA LPTCHR
0240 2770' ISZ N /INCREMENT THE CHARACTER COUNTER.
/TEST IT TO SEE IF FORM FEED.
0241 1351 TAD LPTCHR
0242 1367 TAD (-214 /FF
0243 7640 SZA CLA
0244 5272 JMP NOFF /NO
0245 1373 LOOP1, TAD (212 /YES, PUT THE REQUIRED # LF TO
/FINISH UP THE PAGE.
0246 4766' JMS INSRQ
0247 7402 HLT
0250 4765' JMS CLOSBF /PUT ON QUEUE, AND CLOSE BUFFER..
0251 4775' JMS INITBF /FIX UP BUFFER
0252 2350 ISZ LINCNT /DONE?
0253 5245 JMP LOOP1 /NO
/
/NOW GO 20 20 SPACES TO NEXT PAGE.
0254 7200 LOOP2, CLA
0255 1364 TAD (-20
0256 3350 DCA LINCNT
0257 1373 LOOP3, TAD (212
0260 4766' JMS INSRQ
0261 7402 HLT
0262 4314 JMS OUTPUT /TRY OUTPUT
0263 4765' JMS CLOSBF
0264 4775' JMS INITBF
0265 2350 ISZ LINCNT
0266 5257 JMP LOOP3
0267 1377 TAD (-62 /RESET LINE PER PAGE COUNTER
0270 3350 DCA LINCNT
0271 5210 JMP INPUT
/
0272 1351 NOFF, TAD LPTCHR
0273 4766' JMS INSRQ /PUT ON QUEUE
0274 7402 HLT
0275 1351 TAD LPTCHR
0276 1363 TAD (-212 /IS IT A LF?
0277 7640 SZA CLA
0300 7410 SKP
0301 5304 JMP .+3
0302 4314 JMS OUTPUT /NO, GO CHECK THE OUTPUT
0303 5210 JMP INPUT
/IT WAS A LINEFEED, BOP THE LINE COUNTER
0304 2350 ISZ LINCNT
0305 5310 JMP NORST /DON'T RESET IT
0306 1377 TAD (-62 /RESET IT
0307 3350 DCA LINCNT
0310 4765' NORST, JMS CLOSBF /YES, GO CLOSE THE BUFFER
4
0311 4775' JMS INITBF /OPEN THE NEXT BUFFER
0312 4314 JMS OUTPUT /GO CHECK THE OUTPUT.
0313 5210 JMP INPUT
/
/
/
/
/
/
0314 0000 OUTPUT, 0
0315 6651 LTSF /LINE PRINTER READY?
0316 5714 JMP I OUTPUT /NOT YET
0317 7200 CLA
0320 1347 TAD EMB
0321 7640 SZA CLA
0322 5334 JMP GETOUT /ENABLED, GET THE OUTPUT
0323 7200 CLA /TEST IF ANY BUFFERS
0324 1346 TAD BUFCTR /THE NUMBER OF ACTIVE BUFFERS
0325 7650 SNA CLA
0326 5714 JMP I OUTPUT /NO BUFFERS
0327 7240 CLA CMA
0330 1346 TAD BUFCTR /SET BUFCTR=BUFCTR-1
0331 3346 DCA BUFCTR
0332 7240 CLA CMA
0333 3347 DCA EMB /YES, SET BUFFER FLAG = -1
0334 4762' GETOUT, JMS TTYFQ /GET THE CHAR.
0335 5714 JMP I OUTPUT /NEVER SHOULD GET HERE.
0336 7500 SMA /SEE IF THE CHAR IS 7777, END OF BUFFER.
0337 5343 JMP PUTOUT /NO, GO OUTPUT IT.
0340 7200 CLA
0341 3347 DCA EMB /YES, CLEAR THE ENABLE BUFFER FLAG AND LEAVE
0342 5714 JMP I OUTPUT
0343 6656 PUTOUT, LTLS /OUTPUT IT
0344 7200 CLA
0345 5714 JMP I OUTPUT
0346 0000 BUFCTR, 0
0347 0000 EMB, 0
0350 0000 LINCNT, 0
0351 0000 LPTCHR, 0
/
/
/
0362 0514
0363 7566
0364 7760
0365 0400
0366 0466
0367 7564
0370 0456
0371 0200
0372 0177
0373 0212
0374 7563
0375 0432
0376 0457
5
0377 7716
0400 PAGE
/SUBROUTINE CLOSBF
/PUTS AN EM, N/4+19 NULLS, 7777 AT THE END OF THE BUFFER.
/CALLING SEQUENCE:
/ JMS CLOSBF
/ NORMAL RETURN
0400 0000 CLOSBF, 0
0401 7200 CLA
0402 1377 TAD (31 /EM
0403 4266 JMS INSRQ
0404 7402 HLT /BUFFER OVERFLOW
0405 4776' JMS OUTPUT /TRY TO DO OUTPUT
0406 1256 TAD N /COMPUTE THE N/4 # OF NULLS
0407 7110 CLL RAR
0410 7110 CLL RAR /DIVIDE BY 4
0411 1375 TAD (23 /19
0412 7041 CIA
0413 3231 DCA IBMM
0414 3256 DCA N /ZERO THE CHARACTER COUNTER.
0415 4266 JMS INSRQ
0416 7402 HLT
0417 4776' JMS OUTPUT /TRY TO DO OUTPUT
0420 2231 ISZ IBMM
0421 5215 JMP .-4
0422 7240 CLA CMA /PUT EOF AT END OF BUFFER.
0423 4266 JMS INSRQ
0424 7402 HLT
0425 4776' JMS OUTPUT /TRY TO DO OUTPUT
0426 2774' ISZ BUFCTR /INCREMENT THE BUFFER COUNTER.
0427 5600 JMP I CLOSBF /RETURN
0430 7402 HLT /OVERFLOW
0431 0000 IBMM, 0
/
/SUBROUTINE INITBF
/PUTS A SYN,SOH,8 NULLS IN FRONT OF THE BUFFER.
/CALLING SEQUENCE:
/ JMS INITBF
/ NORMAL RETURN
0432 0000 INITBF, 0 /INIT THE BUFFER.
0433 7200 CLA
0434 3256 DCA N /ZERO THE WORKING CHAR COUNTER.
0435 1373 TAD (26 /SYN
0436 4266 JMS INSRQ
0437 7402 HLT /OVERFLOW
0440 4776' JMS OUTPUT /TRY OUTPUT
0441 1372 TAD (1 /SOH
0442 4266 JMS INSRQ
0443 7402 HLT /OVERFLOW
0444 4776' JMS OUTPUT
0445 1371 TAD (-10 /8
0446 3255 DCA IBM
0447 4266 JMS INSRQ
0450 7402 HLT
0451 4776' JMS OUTPUT /TRY OUTPUT
6
0452 2255 ISZ IBM
0453 5247 JMP .-4 /PUT 8 NULLS IN BUFFER
0454 5632 JMP I INITBF /RETURN
0455 0000 IBM, 0
0456 0000 N, 0 /WORKING CHARACTER COUNTER FOR USE IN COMPUTING NULLS AT EOB.
/
/
/
/
/
/
/
/SUBROUTINE INITQU
/IS USED TO INIT THE QUEUE
/RESETS THE QUEUE.
/CALLING SEQUENCE:
/ JMS INITQU
/ NORMAL RETURN
0457 0000 INITQU, 0
0460 7200 CLA
0461 1370 TAD (TQMIN
0462 3345 DCA KFQ
0463 1345 TAD KFQ
0464 3344 DCA KRQ
0465 5657 JMP I INITQU
/
/
/
/
/
/
/
/
/
/SUBROUTINE INSRQ
/INSERTS A DATA WORD IN THE
/AC--> THE TTY OUTPUT BUFFER
/AT THE REAR OF THE QUEUE.
/CALLING SEQUENCE1G
/ JMS INSRQ /DATA IN AC
/ ERROR RETURN /BUFFER OVERFLOW
/ NORMAL RETURN /DATA ENTERED
/ /RQ POINTER ADVANCED.
/
0466 0000 INSRQ, 0
0467 3346 DCA TQDAT /SAVE DATA
/A.1 COMPUTE NEW KRQ
0470 1342 TAD ITQMAX
0471 7041 CIA
0472 1344 TAD KRQ
0473 7700 SMA CLA
0474 5277 JMP .+3
0475 2344 ISZ KRQ /KRQ<--KRQ+1
0476 5301 JMP .+3
0477 1343 TAD ITQMIN /KRQ<--TQMIN
7
0500 3344 DCA KRQ
/A.2 TEST FOR OVERFLOW
0501 1344 TAD KRQ
0502 7041 CIA
0503 1345 TAD KFQ
0504 7650 SNA CLA
0505 5666 JMP I INSRQ /ERROR RETURN
0506 2266 ISZ INSRQ
/A.3 INSERT DATA INTO THE REAR OF THE QUEUE.
0507 1346 TAD TQDAT
0510 6201 CDF DATFLD
0511 3744 DCA I KRQ
0512 6201 CDF INSTFD
0513 5666 JMP I INSRQ /RETURN
/.........................................
/
/SUBROUTINE TTYFQ
/GET A DATA WORD FROM THE REAR
/OF THE TTY QUEUE-->AC.
/CALLING SEQUENCE:
/ JMS TTYFQ /DATA-->AC
/ ERROR RETURN /BUFFER EMPTY
/ NORMAL RETURN /DATA IN AC.
0514 0000 TTYFQ, 0
/A.1 TEST IF KFQ=KRQ
/IF SO BUFFER EMPTY
0515 7200 CLA
0516 1345 TAD KFQ
0517 7041 CIA
0520 1344 TAD KRQ
0521 7650 SNA CLA
0522 5714 JMP I TTYFQ /ERROR RETURN
0523 2314 ISZ TTYFQ /SET UP NORMAL RETURN.
/A.2 ADVANCE THE KFQ POINTER
0524 7200 CLA
0525 1342 TAD ITQMAX
0526 7041 CIA
0527 1345 TAD KFQ
0530 7700 SMA CLA
0531 5334 JMP .+3 /YES, SET KFQ=TQMIN
0532 2345 ISZ KFQ /NO, SET KFQ=KFQ+1
0533 5336 JMP .+3
0534 1343 TAD ITQMIN
0535 3345 DCA KFQ
/A.3 GET DATA FROM THE QUEUE.
0536 6201 CDF DATFLD
0537 1745 TAD I KFQ
0540 6201 CDF INSTFD
0541 5714 JMP I TTYFQ /RETURN
/...CONSTANTS...
0542 4577 ITQMAX, TQMAX
0543 0601 ITQMIN, TQMIN
0544 0601 KRQ, TQMIN
0545 0601 KFQ, TQMIN
8
0546 0000 TQDAT, 0
/..........................................
/P. LEMKIN, APRIL 14, 1970...
$
0570 0601
0571 7770
0572 0001
0573 0026
0574 0346
0575 0023
0576 0314
0577 0031