perm filename PACK.MAC[PAT,LMM] blob
sn#061980 filedate 1973-09-08 generic text, type T, neo UTF8
COMMENT ⊗ VALID 00010 PAGES
RECORD PAGE DESCRIPTION
00001 00001
00002 00002 TITLE LSPLST
00004 00003 PARAMETER DEFINITIONS PARC XPRINT
00006 00004 PARAMATER DEFINITIONS STANFORD XGP
00008 00005 START: RESET
00009 00006 READ ROUTINE
00011 00007 STORE LINE IN ARRAY --- CHARS ARE ALREADY IN BUFFER
00014 00008 OUTPUT A PAGE
00015 00009 OP1: SETZM P1 OUTPUT PAGE
00018 00010 EOF: SETOM EOFFLG
00019 ENDMK
⊗;
TITLE LSPLST
; CONVERT A FILE INTO DOUBLE COLUMN FILE WITH FONT CONTROL FOR XPRINT
STANSW==0 ; SWITCH 0 FOR PARC XPRINT, 1 FOR SAIL XGP
LEN=4 ; LENGTH OF CURRENT LINE
BITCTR=5 ; NUMBER OF BITS IN THIS COLUMN
FONTHT=6 ; FONT HEIGHT OF THIS LINE
BUFPTR=7 ; NEXT POSITION IN CHAR BUFFER
TMP=14 ; TEM REG
ARCTR=10 ; CURRENT LINE NUMBER (ARRAY INDEX)
P1=11 ; TEMP REG
P2=12 ; TEMP REG
PTR=13 ; BYTE POINTER TO THIS LINE
LINFD==12 ; LINEFEED
EOL=37 ;TENEX EOL
FONTCHR=↑D40 ;LEFT PAREN
;STORAGE AREAS
BUFFER: BLOCK 40000 ; CHARACTER BUFFER
EOFFLG: 0 ; END OF FILE FLAG
PAGNUM: -1 ; PAGE NUMBER-1
INJFN: 0 ; INPUT JFN
OUTJFN: 0 ; OUTPUT JFN
EOP: 0 ; NUMBER OF LINES IN FIRST COL
EOPBITS: 0 ; BITS IN FIRST COLUMN
COL: 0 ; COLUMN NUMBER (0 OR NOT 0)
FONTAR: BLOCK 400 ; ARRAY OF FONT SIZE
PTRAR: BLOCK 400 ; ARRAY OF BYTE POINTERS
LENAR: BLOCK 400 ; ARRAY OF LENGTHS OF LINES
BUFBEG: POINT 7,BUFFER,0; POINTER TO BEGINNING OF BUFFER
; PARAMETER DEFINITIONS PARC XPRINT
IFN STANSW <
SFHT: ↑D19 ; SIZE OF SMALL FONT IN BITS
LFHT: ↑D29 ; SIZE OF LARGE FONT IN BITS
MAXBITS: ↑D2156 ; MAXIMUM BITS/PAGE
MXSTRT: ↑D2156 ; MAXIMUM BITS/PAGE, STARTING VALUE
HDBITS: 4*↑D19 ; BITS IN HEADING - 4 LINES OF SMALL FONT
HEADER: ASCIZ/∀1000.PAGE / ; MIDDLE OF HEADER
ENDHD: ASCIZ/
/ ; END OF HEADER - 3 CRLF'S
XPRNTC: ASCIZ/F LG16X10
F LG26X16
K MJILFT
A
/ ; FILE PREFIX - XPRINT COMMANDS
COMMSTR: ASCIZ #
This should be printed by the command: XPRINT MT0:0/E
#
COL1PR: ASCIZ // ; PREFIX FOR COL 1
COL2PR: ASCIZ /∀654./ ; PREFIX FOR COL 2
BIGSEL: ASCIZ /ε1/ ; SELECT BIG FONT
SMLSEL: ASCIZ/ε0/ ; SELECT SMALL FONT
BSLLEN: 2
SSLLEN: 2
>
; PARAMATER DEFINITIONS STANFORD XGP
IFE STANSW <
SFHT: ↑D19 ; SIZE OF SMALL FONT IN BITS
LFHT: ↑D29 ; SIZE OF LARGE FONT IN BITS
MAXBITS: ↑D2156 ; MAXIMUM BITS/PAGE
MXSTRT: ↑D2156 ; MAXIMUM BITS/PAGE, STARTING VALUE
HDBITS: 4*↑D19 ; BITS IN HEADING - 4 LINES OF SMALL FONT
HEADER: BYTE (7)177,1,40(↑D14)1001,0 ;MIDDLE OF HEADER
;MUSTNT HAVE ZERO BYTE
ENDHD: ASCIZ/
/ ; END OF HEADER - 3 CRLF'S
XPRNTC: ASCIZ//
COMMSTR: ASCIZ "
This should be printed with the command:
XS FILE/FONT=FIX13X.FNT[PAT,LMM]/FONT#1=NGB25.FNT[PAT,LMM]/LMAR=100
" ; FILE PREFIX - XPRINT COMMANDS
COL1PR: ASCIZ // ; PREFIX FOR COL 1
COL2PR: BYTE (7)177,1,40(↑D14)745(7)0 ; PREFIX FOR COL 2
BIGSEL: BYTE (7)177,1,1 ; SELECT BIG FONT
BSLLEN: 3
SMLSEL: BYTE (7)177,1,0 ; SELECT SMALL FONT
SSLLEN: 3
>
START: RESET
SETZM EOFFLG
SETOM PAGNUM
SETZM EOP
SETZM EOPBITS
SETZM COL
MOVE 1,MXSTRT
MOVEM 1,MAXBITS
HRROI 1 , [ASCIZ /
INPUT FILE: /]
PSOUT
MOVSI 1 , 100003
MOVE 2, [XWD 100,101]
GTJFN
JUMPA START
MOVEM 1,INJFN
START2: HRROI 1 , [ASCIZ /
OUTPUT FILE: /]
PSOUT
MOVSI 1,460003
MOVE 2,[XWD 100,101]
GTJFN
JUMPA START2
MOVEM 1,OUTJFN
;OPEN FILES
OPEN: MOVE 1,INJFN
MOVSI 2,7B23
HRRI 2,201000
OPENF
JUMPA START
MOVE 1,OUTJFN
MOVSI 2,7B23
HRRI 2,101000
OPENF
JUMPA START
; READ ROUTINE
MOVE BUFPTR,BUFBEG ; INITIALIZE BUFFER POINTER
SETZB ARCTR,BITCTR
NEWLIN: SETZM LEN ; ZERO LENGTH
MOVE PTR,BUFPTR ;SAVE BEGINNING PTR
MOVE 1,INJFN
INLIN: BIN ; GET A CHARACTER CHECK BIN SETUP
MOVE 3,2
GTSTS
TLNE 2,↑D512 ; CHECK IF END OF FILE
JUMPA EOF
CAIN 3,EOL ; BREAK?
JUMPA ADLIN
CAIN 3,LINFD ; LINEFEED?
SOJA LEN,ADLIN ; IGNORE PREV CHAR TOO
IDPB 3,BUFPTR ; CRAM IT INTO BUFFER
AOJA LEN, INLIN ; INCREMENT LEN, AND GO BACK
ADLIN: MOVE 2,PTR
ILDB 2,2
MOVE FONTHT,SFHT
CAIN 2,FONTCHR ;CHECK WITH FONTH CHANGE CHAR
MOVE FONTHT,LFHT
JUMPA OUTLIN ; CHECK IF AT END OF LINE
DATERR: HALTF
; STORE LINE IN ARRAY --- CHARS ARE ALREADY IN BUFFER
OUTLIN:
LP: SKIPE COL
JUMPA LP2 ;IF COL≠0 THEN GO LP2
ADD BITCTR , FONTHT ;BITCTR←BITCTR+FONTHT
CAMG BITCTR , MAXBITS
JUMPA BUMP ;IF BITCTR≤MAXBITS THEN GO BUMP
SUB BITCTR , FONTHT
MOVEM BITCTR , EOPBITS ;EOPBITS←BITCTR-FONTHT
MOVEM ARCTR , EOP ;EOP←ARCTR
SETZM BITCTR ;BITCTR=0
SETOM COL ;COL=-1
LP2: ADD BITCTR,FONTHT ;BITCTR←BITCTR+FONTHT
CAMLE BITCTR , MAXBITS
JUMPA OUTPAGE ;IF BITCTR>MAXBITS THEN GO OUTPAGE
MOVE 1, ARCTR
SUB 1 , EOP
CAML 1,EOP
JUMPA BUMP ; NO CORRESP LINE IN COL 1
MOVN 1 , FONTAR+1(1) ; GET -HT OF CORRESP LINE IN COL 1
ADD 1 , FONTHT ; ADD FONTHT
JUMPL 1, [ SUB BITCTR,1
CAMG BITCTR,MAXBITS
JUMPA BUMP
JUMPA OUTPAGE]
ADDB 1,EOPBITS ; ADD TO EOPBITS
CAMG 1,MAXBITS
JUMPA BUMP ; ITS OK, JUST INC EOPBITS
SOS 1 , EOP
SETZM BITCTR ; GOT TO RECOMPUTE EOPBITS AND BITCTR
MOVE 1,ARCTR
SUB 1,EOP ; FOR I-1 TO 1 FROM ARCTR-EOP DO
JUMPLE 1,AFTADLP ; I LE 0 ALREADY?
MOVE 2,1
ADD 2,EOP ; GET EOP+I IN 2
ADLP: MOVE 3,FONTAR(1) ; HT OF ITH LINE
CAMGE 3,FONTAR(2)
MOVE 3,FONTAR(2) ; GET MAX FONT HT IN 3
ADD BITCTR,3 ; AND ADD TO BITCTR
SOS 2 ; DECREMENT 3
SOJG 1,ADLP ; AND I, IF NOW ONE, GO TO ADLP
AFTADLP: MOVE 2,BITCTR
MOVEI 1,1(ARCTR)
SUB 1,EOP
MOR: CAMLE 1,EOP
JUMPA AFTMOR
ADD 2,FONTAR(1)
AOJA 1,MOR
AFTMOR: MOVEM 2,EOPBITS
JUMPA LP2
BUMP: AOS 1 , ARCTR ; INCREMENT ARCTR
MOVEM FONTHT , FONTAR (1) ; STORE IN ARRAYS
MOVEM PTR , PTRAR (1)
MOVEM LEN , LENAR (1)
JUMPA NEWLIN
; OUTPUT A PAGE
OUTPAGE:MOVE 1,OUTJFN
AOSN TMP,PAGNUM ;GET PAGE NUMBER
JUMPA PAG1 ; FIRST PAGE
SETZM 3
HRRZ 2,INJFN
JFNS ; PUT FILE NAME OUT
HRROI 2,HEADER
SETZM 3
SOUT ; OUTPUT MIDDLE PART OF HEADER
MOVEI 2,1(TMP)
MOVE 3,[120004000012]
NOUT ; PRINT PAGE NUMBER - 3 COLS, LEADING BLANKS
SKIP ; NOP HERE
HRROI 2,ENDHD
SETZM 3
SOUT ; PRINT BUNCH OF CRLFS FOR END OF HEADER
JUMPA OP1
PAG1: MOVN TMP, HDBITS ; FIRST PAGE ONLY
ADDM TMP, MAXBITS ; SUBTRACT HDBITS FROM MAXBITS
HRROI 2,XPRNTC
SETZM 3
SOUT ; WRITE XPRINT COMMANDS
OP1: SETZM P1 ; OUTPUT PAGE
MOVE P2 , EOP
MOVE TMP , LFHT
OPLP: AOS P1
AOS P2
CAMLE P1 ,EOP
JUMPA NOC1
HRROI 2 , COL1PR
SETZM 3
SOUT ; INSERT COL1 COL SELECT
MOVN 3 , LENAR (P1)
JUMPE 3 , NOC1 ; IF NULL LINE, FORGET IT
CAME TMP,FONTAR(P1)
JUMPA OC1
HRROI 2, BIGSEL
MOVN 3, BSLLEN
SOUT
MOVN 3, LENAR(P1) ; IF BIG FONT THEN OUTPUT BIGSEL AND RESET LEN
OC1: MOVE 2, PTRAR (P1)
SOUT ; OUTPUT 1ST COL
CAME TMP,FONTAR(P1)
JUMPA NOC1
HRROI 2,SMLSEL
MOVN 3,SSLLEN
SOUT ; RESET TO SMALL FONT
NOC1: CAMLE P2 , ARCTR
JUMPA [ CAMLE P1,EOP
JUMPA FINISH
JUMPA OUTCRLF ]
HRROI 2 , COL2PR
SETZM 3
SOUT ; INSERT COL2 SELECT
MOVN 3 , LENAR (P2)
JUMPE 3 , OUTCRLF ; IF ZERO LEN THEN FORGET IT
CAME TMP,FONTAR(P2)
JUMPA OC2
HRROI 2 , BIGSEL
MOVN 3,BSLLEN
SOUT ; IF BIG FONT, THEN OUTPUT SELECT CHARS
MOVN 3 , LENAR(P2)
OC2: MOVE 2, PTRAR (P2)
SOUT ; OUTPUT SECOND COLUMN
CAME TMP,FONTAR(P2)
JUMPA OUTCRLF
HRROI 2 , SMLSEL
MOVN 3, SSLLEN
SOUT
OUTCRLF:HRROI 2 , [ASCIZ /
/] ; GET CRLF
SETZM 3
SOUT ; OUTPUT IT
JUMPA OPLP
FINISH: MOVEI 2 , ↑D12 ; GET FORM FEED
BOUT ; END OF PAGE, SEND IT
SKIPE EOFFLG
JUMPA CLOSE
MOVE 2 , BUFBEG
MOVE 3 , LEN
LPMOV: ILDB 1 , PTR ; MOV LEN BYTES FROM PTR TO BUFBEG
IDPB 1 , 2
SOJG 3 , LPMOV
MOVE PTR , BUFBEG ; SET PTR BACK TO BEGINNING OF BUFFER
INIT: SETZB BITCTR,EOP
SETZB ARCTR,EOPBITS
SETZM COL
JUMPA LP
EOF: SETOM EOFFLG
LDB 2,PTR
MOVE FONTHT,SFHT
CAIN 2,FONTCHR
MOVE FONTHT,LFHT
AOS ARCTR
SKIPN EOP
MOVEM ARCTR,EOP
MOVEM FONTHT, FONTAR(ARCTR)
MOVEM PTR,PTRAR(ARCTR)
MOVEM LEN, LENAR(ARCTR)
JUMPA OUTPAGE
CLOSE: MOVNI 1,1
CLOSF
HALTF
HALTF
JUMPA START
END START