--- /dev/null
+* (O$LA)
+*
+* *********** MODIFIED MODIFIED !!!! *****************
+*
+* FOR VISIBLE PUNCHES !!!!!
+*
+* PROGRAM TITLE: O$LA (O$LA,O$LE,O$LH,O$LC,O$LF)
+* LINE PRINTER ROUTINES
+*
+* REVISIONS:
+* 1.0 (2005-02.04)
+*
+* AUTHOR
+*
+* PHILIPP HACHTMANN
+*
+*
+* PURPOSE
+*
+* THESE ARE THE LIBRARY ROUTINES FOR HACHTI'S LINE PRINTER INTERFACE
+*
+*
+* RESTRICTIONS
+*
+* DEPENDS ON HACHTI'S HARDWARE AND FORTRAN IV COMPILER TAPE
+*
+*
+* STORAGE
+*
+* 420 (OCTAL)
+* 271 (DECIMAL)
+*
+*
+* USE
+*
+* CALL O$LA
+* DAC (BUFFER ADDRESS)
+* NORMAL
+*
+* THIS PRINTS ONE LINE OF LISING TEXT
+* (60 2-CHAR WORDS MAX) TO THE LINE PRINTER.
+*
+*
+* CALL O$LH
+* DAC (HEADING ADDRESS)
+* NORMAL RETURN
+*
+* SETUP THE LISTING HEADER
+* RESETS THE PAGE COUNTER AND SPACES TO THE BEGINNING OF
+* THE NEXT PAGE.
+*
+*
+* CALL O$LP
+* DAC (BUFFER ADDRESS)
+* NORMAL RETURN
+*
+* PRINT TEXT FROM BUFFER. NO CR OR LF IS OUTPUT.
+*
+* CALL O$LC
+* NORMAL RETURN
+*
+* PRODUCE A CARRIAGE RETURN ON THE LINE PRINTER.
+*
+*
+* CALL O$LF
+* NORMAL RETURN
+*
+* SEND A LINE FEED COMMAND TO THE PRINTER.
+*
+*
+* CALL O$LE
+* NORMAL RETURN
+*
+* EJECT CURRENT PAGE
+* SPACES TO THE BEGINNING OF THE NEXT PAGE BY SENDING
+* A FF CHARACTER TO THE PRINTER.
+*
+********************************************************************************
+*
+ SUBR O$LA TYPE A COMPLETE LINE WITH CR/LF, HEADING ETC.
+ SUBR O$LH INITIALISE HEADING
+ SUBR O$LP,T1 TYPE A LINE, NO CR
+ SUBR O$LC,T20 RETURN THE CARRIAGE
+ SUBR O$LF,T30 ADVANCE TO NEXT LINE
+ SUBR O$LE,FF EJECT PAGE
+*
+ SUBR O$LSK1,SKP1 EMPTY LINES BETWEEN TOP OF PAGE AND HEADING
+ SUBR O$LSK2,SKP2 EMPTY LINES BETWEEN HEADING AND MAIN TEXT
+ SUBR O$LLPP,LPP PURE TEXT LINES PER PAGE
+ SUBR O$LRS,RS DISTANCE FROM PAGE NUMBERING TO RIGHT MARGIN
+*
+********************************************************************************
+*
+ REL RELOCATEABLE MODE
+*
+* CONFIGURATION
+SKP1 DEC 1 EMPTY LINES BEFORE HEADING
+SKP2 DEC 3 EMPTY LINES BETWEEN HEADING AND TEXT
+LPP DEC 60 DATA LINES PER PAGE (WITHOUT HEADING ETC.)
+LNW DEC 60 LINE LENGTH IN 2-CHAR WORDS
+RS DEC 1 RIGHT DISTANCE FOR PAGE NUMBERING (2-CHAR WORDS)
+*
+*
+O$LA DAC **
+ LDA* O$LA BUFFER ADDRESS
+ STA LBUF STORE
+ LDA LINE LEFT LINE COUNTER
+ SZE LINES LEFT ON PAGE?
+ JMP PGOK YES, JUMP AWAY
+ JST FF CALL FORM FEED ROUTINE
+PGOK LDA LPP LINES PER PAGE
+ TCA
+ CAS LINES ARE WE ON THE FIRST LINE?
+ JMP *+2 NO, WE ARE NOT.
+ JST NP MAKE HEADER, SPACING ETC.
+ NOP
+ IRS LINE BUMP COUNTER
+ NOP WE DON'T CONTROL THAT HERE ANYMORE
+ JST T1 PRINT THE LINE
+LBUF DAC ** ADDRESS OF LINE BUFFER
+ JST T20 CARRIAGE RETURN
+ JST T30 LINE FEED
+ IRS O$LA MAKE RETURN ADDRESS
+ JMP* O$LA RETURN
+*
+*
+O$LH DAC ** INIT HEADING
+ LDA* O$LH
+ STA P1 POINTER TO SOURCE
+ LDA HBUP
+ STA P2 POINTER TO TARGET
+ LDA LNW LINE LENGTH
+ TCA
+ STA CNT
+HL1 LDA* P1
+ STA* P2
+ IRS P1
+ IRS P2
+ IRS CNT READY?
+ JMP HL1 NO
+ LDA LPP LINES PER PAGE
+ TCA RENEW
+ STA LINE THE LINE COUNTER
+ IRS O$LH ADJUST ADDRESS
+ CRA
+ STA LN1 CLEAR PAGE NUMBERING
+ STA LN2 CLEAR PAGE NUMBERING
+ STA LN3 CLEAR PAGE NUMBERING
+ JMP* O$LH RETURN
+*
+*
+*
+NP DAC ** PREPARE NEW PAGE
+ LDA SKP1 SPACES BEFORE HEADING
+ SNZ SPACING REQUIRED?
+ JMP NHDS NO SPACE BEFORE HEADING
+ TCA
+ STA CNT
+S1 JST T30 LINE FEED
+ IRS CNT
+ JMP S1
+NHDS JST LNNR PREPARE LINE NUMBERING
+ JST T1 TYPE HBUF
+HBUP DAC HBUF ADDRESS OF HEADER BUFFER
+ JST T20 CARRIAGE RETURN
+ JST T30 LINE FEED
+ LDA SKP2 NUMBER OF SPACES BEFORE TEXT
+ SNZ SPACING REQUIRED?
+ JMP NSPC NO, IT'S NOT.
+ TCA NEGATE
+ STA CNT TO COUNTER
+SP1 JST T30 LINE FEED
+ IRS CNT DEC COUNTER, SKIP IF READY
+ JMP SP1 NOT READY
+NSPC JMP* NP RETURN
+*
+* FORM FEED
+FF DAC **
+ JMP* FF RETURN
+*
+*
+* VARIABLES
+XR DEC 0 THE CALLER'S X REGISTER
+CNT DEC 0
+HBP DAC HBUF
+HBUF BCI 20,
+ BCI 20,
+ BCI 20,
+P1 DEC 0 POINTER 1
+P2 DEC 0 POINTER 2
+LINE DEC -40 NEG LINES LEFT ON PAGE
+PGS BCI 5, PAGE XXX
+PGSP DAC PGS POINTER TO PGS
+*
+*
+************************************************************
+*
+* OUTPUT LINE
+T1 DAC **
+ STX XR SAVE CALLER'S INDEX REGISTER
+ LDA* T1
+ ADD LNW LINE WIDTH
+ ADD ='40000 SET TAG
+ STA T6
+ IRS T1
+ LDA LNW LINE WIDTH
+ TCA NEGATE
+ STA 0
+T3 LDA* T6
+ CAS ='120240
+ JMP *+2
+*
+ JMP T8
+T4 JST T14
+ IRS 0
+ JMP T3
+ LDX XR RESTORE CALLER'S INDEX REGISTER
+ JMP* T1
+T6 *** **
+*
+*
+T8 LDA 0
+ STA T12
+T10 IRS 0
+ JMP *+2
+ JMP* T1
+ LDA* T6
+ CAS ='120240
+ JMP *+2
+ JMP T10
+ LDA T12
+ STA 0
+ LDA ='120240
+ JMP T4
+T12 *** **
+*
+*
+T14 DAC **
+ ICA
+ STA DAT1
+ CALL VPUNCH
+DAT1 DEC 0
+ ICA
+ STA DAT2
+ CALL VPUNCH
+DAT2 DEC 0
+ JMP* T14
+****
+*
+* CARRIAGE RETURN
+T20 DAC *
+ LDA =32 LEERZEICHEN
+ STA DAT2
+ CALL VPUNCH
+DAT3 DEC 0
+ JMP* T20 RETURN
+*
+* LINE FEED
+T30 DAC **
+ JMP* T30
+*
+* PRINT LINE NUMBER TO BUFFER
+LNNR DAC ** INCREMENT LINE NUMBER, PUT TO BUFFER
+ JST LNR INCREMENT DIGIT
+LN1 DEC 0 LEAST SIGNIFICAND DIGIT
+ JMP RDY NO CARRY, COUNTING READY
+ JST LNR INCREMENT DIGIT
+LN2 DEC 0 SECOND DIGIT
+ JMP RDY NO CARRY, COUNTING READY
+ JST LNR INCREMENT DIGIT
+LN3 DEC 0 THIRT DIGIT
+ NOP NO CARRY, FINE
+RDY NOP OVERFLOW, BUT WHAT SHOULD WE DO?
+*
+*
+ LDA LN3 LEFTMOST VALUE (100)
+ JST MDG CONVERT
+ LRR 8 SHIFT DOWN
+ LDA =32 SPACE
+ LLR 8 SHIFT BACK
+ STA PGS+3 STORE
+*
+ LDA LN1 RIGHTMOST DIGIT (1)
+ ADD =48 ZERO CHARACTER
+ LRR 8 SHIFT AWAY
+ LDA LN2 MIDDLE VALUE (10)
+ JST MDG CONVERT
+ LLR 8 SHIFT UP AGAIN
+ STA PGS+4 STORE INTO POSITION
+*
+*
+ LDA HBP HEADER BUFFER ADDRESS
+ ADD LNW PAGE WIDTH
+ SUB RS RIGHT SPACING
+ ADD ='40000 SET INDEX BIT
+ STA P1 TO POINTER
+ LDA PGSP PAGE NUMBER BUFFER ADDRESS
+ ADD =5 ADD PAGE NUMBERING LENGTH
+ ADD ='40000 SET INDEX BIT
+ STA P2 TO POINTER
+ LDA =-5
+ STA 0
+PP1 LDA* P2
+ STA* P1
+ IRS 0
+ JMP PP1
+ JMP* LNNR RETURN
+*
+*
+MDG DAC ** MAKE DIGIT FROM A
+ SZE
+ JMP NZ NO ZERO
+ LDA =32 IS ZERO->SPACE
+ JMP* MDG RETURN
+NZ ADD =48 THE ZERO CHARACTER
+ JMP* MDG
+*
+*
+LNR DAC ** DIGIT SERVICE
+ IRS* LNR INCREMENT DIGIT
+ LDA* LNR LOAD NEW VALUE OF DIGIT
+ SUB =10 TEST IF OVERFLOW
+ SZE OVERFLOW?
+ JMP NOFL NO, TAKE FIRST RETURN
+ STA* LNR YES, CLEAR DIGIT (A WAS ZERO)
+ IRS LNR TALLY RETURN ADDRESS
+NOFL IRS LNR TALLY RETURN ADDRESS
+ JMP* LNR
+*
+ FIN WRITE OUT LITERALS
+*
+* PUH.....
+*
+ END