;*************************************************************************** ;* * ;* HTML PRINTER DRIVER * ;* For use with AlphaWRITE 2.2 * ;* * ;*************************************************************************** ;21-Dec-95 created from AlphaWRITE 2.2. MISC.M68 (MISC.PDV) by David Pallmann. ; ;This driver creates [simple] HTML documents. Standard text paragraphs are ;converted, along with underscore, bold, and italic effects. OBJNAM .PDV VMAJOR =2 VMINOR =2 VSUB =0 VEDIT =450. VWHO =0 ;**************** ;* universals * ;**************** SEARCH SYS SEARCH SYSSYM COPY PDVSYM ;********************** ;* assembly options * ;********************** ; ; UNDTYP controls how underlining is performed. A setting of zero ; returns the carriage to the far left and types underscores. A ; setting of 1 outputs a backspace-and-underscore after each ; character. ; ; In the same fashion, BLDTYP controls how bolding is performed. UNDTYP =0 ; 0=CR method, 1=BS method BLDTYP =0 ; 0=CR method, 1=BS method ;*************************************** ;* AlphaWRITE 2.0 special characters * ;*************************************** C$NXB =^H0CB ; non-exandable space C$DEG =^H0CE ; degree symbol C$PAR =^H0CF ; paragraph symbol C$DAG =^H0D0 ; dagger C$SEC =^H0D1 ; section symbol C$CNT =^H0D2 ; cent sign C$QTR =^H0D3 ; 1/4 C$HAF =^H0D4 ; 1/2 C$TM =^H0D5 ; trademark symbol C$CPY =^H0D6 ; copyright symbol C$REG =^H0D7 ; registered symbol C$STR =^H0E1 ; star C$BLT =^H0E2 ; bullet C$EMD =^H0E3 ; em dash C$END =^H0E4 ; en dash C$RTN =^H0E6 ; RETURN keycap ;****************** ;* $SPLFL flags * ;****************** PF$CPY =1 ; number of copies specified PF$DEL =2 ; delete file after printing PF$BAN =4 ; print leading banner page PF$HDR =10 ; print header at top of each page PF$FF =20 ; print form feeds PF$FRM =400 ; use specified form name PF$INF =100000 ; inform user when printing done ;********************************* ;* impure area local variables * ;********************************* ;indexed by A3 BLDMAX =200. ; size of bold text buffer .OFINI RESVUS .OFDEF FLAGS, 2 ; flags: F$BLD =1 ; bold enabled F$ITA =2 ; italic enabled F$FNT =4 ; font selection required F$PRO =10 ; proportionally spacing F$UND =20 ; underscore in effect .OFDEF CURFNT, 1 ; current font letter/digit .OFDEF CURSIZ, 1 ; current font size (height in points) .OFDEF PITCH, 1 ; pitch .OFDEF TABFLG, 1 ; tab adjustment flip-flop .OFDEF LFTOFF, 4 ; left paper offset (centipoints) [255] .OFDEF H.LOC, 4 ; horizontal location in centipoints [255] .OFDEF V.LOC, 2 ; vertical location in points .OFDEF V.SIZ, 2 ; size of a line in points .OFDEF TOPMGN, 2 ; top margin (points) .OFDEF SAVLPI, 1 ; saved lines-per-inch .OFDEF UNUSED, 1 ; unused (even up address) .OFDEF REMREG, 2 ; remainder register .OFDEF PAGSIZ, 2 ; page size .OFDEF SPCSIZ, 2 ; space expansion size (centipoints) .OFDEF SPCACC, 2 ; accummulating space size (centipoints) .OFDEF CHRSIZ, 2 ; size of a character (centipoints) .OFDEF OUTCOL, 2 ; current column (1..n) .OFDEF UNDSTA, 2 ; underscore: starting column .OFDEF UNDEND, 2 ; underscore: ending column .OFDEF BLDSTA, 2 ; bold: starting column .OFDEF BLDEND, 2 ; bold: ending column .OFDEF BLDTXT, BLDMAX ; bold buffer .OFDEF BLDIDX, 4 ; bold buffer address .OFDEF BLDSIZ, 2 ; bold text size .OFDEF CHARS, 2 ; characters output so far, curr line. .OFSIZ MEMSIZ IF GT,MEMSIZ-PDVEXT,ASMERP "?Impure area size exceeded" ;************ ;* macros * ;************ ;add word (memory to memory) DEFINE ADDW2 SRC,DST MOVW SRC,D7 ADDW D7,DST ENDM DEFINE ADD2 SRC,DST MOV SRC,D7 ADD D7,DST ENDM ;subtract word (memory to memory) DEFINE SUBW2 SRC,DST MOVW SRC,D7 SUBW D7,DST ENDM ;output ASCIZ string to output file DEFINE OUTSTR ADDR LEA A6,ADDR CALL OUT.STRING ENDM ;test flag bit in a word DEFINE BITW SRC,DST MOVW DST,D7 ANDW SRC,D7 ENDM PAGE ;*************** ;* PDV entry * ;*************** ;Define the entry points of the .PDV ; ; CAUTION: Do not change the order or size of the entry points. ; If any of the functions are not implemented replace the entry ; point with 'JMP IGNORE'. ; ; A3 indexes the impure area defined above on entry to the driver. PDVFLG =PD$W20!PD$EXT!PD$PTS!PD$BLD!PD$FNT!PD$EDG!PD$TOP!PD$PCH ; == printer characteristics == ; AlphaWRITE 2.0 compatible ; points-oriented calling interface ; bold style ; selectable fonts ; can print at edge of page ; top-of-char printhead orientation ; variable word spacing ; can return printer characteristics PDV: PHDR -1,0,PH$REE!PH$REU ; program header LWORD PDVFLG ; printer driver flags JMP PDINI ; PDINI, initialize printer JMP PDCLS ; PDCLS, shut down printer JMP PDCHR ; PDCHR, output a character in D1 JMP PDCTLX ; PDCTL, output control string indexed [391] ; by D1 (implement, but do not [391] ; register call in bitmap) [391] JMP IGNORE ; PDSPL, output special string & character JMP PDMNLN ; PDMNLN, move to next line & start new line JMP PDMTOF ; PDMTOF, move to Top of Form & setup for new page JMP PDPSON ; PDPSON, enable proportional JMP PDPSOF ; PDSOF, disable proportional JMP PDUNDR ; PDUNDR, toggle underscore JMP PDBOLD ; PDBOLD, toggle bold JMP IGNORE ; PDSTRK, toggle strikeout JMP IGNORE ; PDBAR, toggle over-bar JMP PDSLPI ; PDSLPI, set Lines Per Inch JMP IGNORE ; PDSHMI, set Horizontal Motion Index JMP PDSCPI ; PDSCPI, set Characters Per Inch JMP IGNORE ; PDSTM, set Top Margin JMP PDMTM ; PDMTM, move to Top Margin JMP PDSLPO ; PDSLPO, set Left Paper Offset JMP PDMLPO ; PDMLPO, move to Left Paper Offset JMP PDSLPP ; PDSLPP, set Lines per Page JMP PDSLSP ; PDSLSP, set line spacing (in 1/2 lines) JMP PDOVRP ; PDOVRP, setup to overprint last char. JMP PDLF ; PDLF, output LFs per count in D2 JMP PDUNDR ; PDDBL, double underscore JMP PDFONT ; PDFONT, set font JMP IGNORE ; PDECHR, extended character (obsolete) JMP IGNORE ; ENTRY RESERVED FOR ALPHA MICRO JMP IGNORE ; ENTRY RESERVED FOR ALPHA MICRO JMP IGNORE ; ENTRY RESERVED FOR ALPHA MICRO JMP IGNORE ; ENTRY RESERVED FOR ALPHA MICRO JMP IGNORE ; ENTRY RESERVED FOR ALPHA MICRO JMP IGNORE ; ENTRY RESERVED FOR USER DEFINITION JMP IGNORE ; ENTRY RESERVED FOR USER DEFINITION JMP IGNORE ; ENTRY RESERVED FOR USER DEFINITION JMP IGNORE ; ENTRY RESERVED FOR USER DEFINITION JMP IGNORE ; ENTRY RESERVED FOR USER DEFINITION JMP IGNORE ; ENTRY RESERVED FOR USER DEFINITION JMP IGNORE ; ENTRY RESERVED FOR USER DEFINITION JMP IGNORE ; ENTRY RESERVED FOR USER DEFINITION JMP PDPSIZ ; PDPSIZ, set page size to points in D2 JMP PDTMAR ; PDTMAR, set top margin to points in D2 JMP IGNORE ; ENTRY RESERVED FOR ALPHA MICRO JMP IGNORE ; ENTRY RESERVED FOR ALPHA MICRO JMP IGNORE ; ENTRY RESERVED FOR ALPHA MICRO JMP PDLEFT ; PDLEFT, set left paper offset to points in D2 JMP IGNORE ; PDLEAD, set leading to points in D2 JMP IGNORE ; PDFNAM, set font by name (ASCIZ string @A6) JMP PDFSIZ ; PDFSIZ, set font size to points in D2 JMP PDITAL ; PDITAL, toggle italic JMP IGNORE ; PDSCRN, toggle screened JMP IGNORE ; PDREV, toggle reverse JMP PDFATR ; PDFATR, set font attributes directly JMP PDMCHR ; PDMCHR, move to char position in D2 JMP PDMLIN ; PDMLIN, move to line position in D2 JMP PDMOVE ; PDMOVE, move to points (D1,D2) coordinates JMP IGNORE ; PDSAVE, save print state JMP IGNORE ; PDREST, restore print state JMP PDFTBL ; PDFTBL, return index to font table in A6 JMP PDCHR ; PDOUT, directly output byte in D1 JMP IGNORE ; PDSPOR, set page orientation (D1 = "P" or "L") JMP IGNORE ; PDGRAY, set gray scale (D2 = % blk) JMP IGNORE ; PDGRAF, perform graphics. func (D2) JMP PDFSUB ; PDFSUB, perform font substitution (font code in D1) JMP IGNORE ; PDTRSC, translate special character D1 JMP IGNORE ; PDTREC, translate extended character D1 JMP PDOTSC ; PDOTSC, output special character D1 JMP PDCHR ; PDOTEC, output extended character D1 JMP IGNORE ; PDSETL, set line weight to points in D2 JMP IGNORE ; PDPOVR, print page overlay (D2 indexes text) JMP IGNORE ; PDIMON, begin image/icon JMP IGNORE ; PDIMOF, end image/icon JMP IGNORE ; PDKEY, toggle keycap JMP IGNORE ; PDCART, set cartridge as per D2 JMP IGNORE ; PDKERN, set kerning as per D2 JMP IGNORE ; PDSPAG, set page printing JMP IGNORE ; PDOUTL, toggle outline fonts JMP IGNORE ; PDCBAR, toggle change bars JMP PDPCH ; PDPCH, return printer characteristics IGNORE: RTN ; just return to caller of .PDV PAGE ;*********** ;* PDINI * ;*********** ;Function: Initialize the printer PDINI: OUTSTR PRTINI ; output printer initialization MOVB #'C,CURFNT(A3) ; say current font is Courier MOVB #10.,CURSIZ(A3) ; say current font size is 10 MOVW #F$FNT,FLAGS(A3) ; flag for font selection MOVB #12.,PITCH(A3) ; pre-set pitch to 12 CPI CLR H.LOC(A3) ; set starting point [255] CLRW V.LOC(A3) ; on page MOVW #72./8.,V.SIZ(A3) ; set line size MOVB #8.,SAVLPI(A3) ; 6 lpi MOVW #1,OUTCOL(A3) ; at column one MOVW #7200./10.,CHRSIZ(A3) ; set size of a character in centipoints [171] RTN ; return ;printer initialization PRTINI: ASCII "" BYTE $CR,$LF ASCII "
" BYTE $CR,$LF ASCII "" BYTE $CR,$LF ASCII "" BYTE $CR,$LF BYTE 0 ; ** end of printer initialization ** EVEN ;*********** ;* PDCLS * ;*********** ;Function: Shut down the printer PDCLS: MOV #PF$DEL!PF$CPY!PF$FRM!PF$FF,SPLPOS(A3) ; /DELETE/COPIES:n/FORMS:ffff/FORMFEED [190] MOV #PF$INF,SPLNEG(A3) ; /NOINFORM [190] OUTSTR PRTCLS ; output printer shut-down RTN ; return ;printer shut-down PRTCLS: ASCII "" BYTE $CR,$LF ASCII "" BYTE $CR,$LF BYTE 0 ; ** end of printer shut-down ** EVEN ;*********** ;* PDCHR * ;*********** ;Function: Output character ; ;Inputs: D1 - character to output PDCHR: INCW CHARS(A3) ; BCALL SPCOUT ; ;proportional space handling CMPB D1,#40 ; space? BNE 10$ ; no BITW #F$PRO,FLAGS(A3) ; proportional spacing in effect? BEQ 10$ ; no ADDW2 SPCSIZ(A3),SPCACC(A3) ; CMMW SPCACC(A3),CHRSIZ(A3) ; BLO 10$ ; BCALL SPCOUT ; SUBW2 CHRSIZ(A3),SPCACC(A3) ; 10$: RTN ; return SPCOUT: FILOTB PTDDB(A3) ; output character INCW OUTCOL(A3) ; update column BCALL PROCESS ; process bold/underscore for char ;[171] MOV #7200.,D6 ; ;[171] CLR D7 ; ;[171] MOVB PITCH(A3),D7 ; get pitch ;[171] BEQ 10$ ; zero somehow?! ;[171] DIV D6,D7 ; ;[171] ADDW D6,H.LOC(A3) ; CLR D7 ; [255] MOVW CHRSIZ(A3),D7 ; [255] ADD D7,H.LOC(A3) ; [171][255] 10$: RTN ; ;************* ;* PROCESS * ;************* ;Function: Process character, handle bolding and underscoring if enabled ; Called right after a character has been output ; ;Inputs: D1 - character just output PROCESS: BITW #F$BLD,FLAGS(A3) ; bolding? BEQ 20$ ; no ;handling for bold (CR and BS style) IF EQ,BLDTYP SAVE A6,D1 ; CR: save registers MOV BLDIDX(A3),A6 ; CR: index bold buffer MOVB D1,(A6)+ ; CR: store byte INC BLDIDX(A3) ; CR: update index INCW BLDSIZ(A3) ; CR: update size CMPW BLDSIZ(A3),#BLDMAX-2 ; CR: overflow? BLO 10$ ; CR: no CALL BLDOFF ; CR: turn off bold CALL BLDON ; CR: turn it back on 10$: REST A6,D1 ; CR: restore registers IFF PUSHW D1 ; BS: save character MOVB #'H-'@,D1 ; BS: output FILOTB PTDDB(A3) ; BS: backspace POPW D1 ; BS: restore character FILOTB PTDDB(A3) ; BS: output character again ENDC 20$: ;handling for underscore BS style IF NE,UNDTYP BITW #F$UND,FLAGS(A3) ; BS: underscore enabled? BEQ 30$ ; BS: no PUSHW D1 ; BS: save character MOVB #'H-'@,D1 ; BS: output FILOTB PTDDB(A3) ; BS: backspace MOVB #'_,D1 ; BS: output FILOTB PTDDB(A3) ; BS: underscore POPW D1 ; BS: restore character 30$: ENDC RTN ; ;************ ;* PDCTLX * [391] ;************ ;(we use non-standard label so PDVBMP macro will indicate that control ;functions are not guaranteed to be supported in this driver). ;Function: Output a control string. ; ;Inputs: D1 - string index PDCTLX: SAVE D1 ; save registers [391] CMPB D1,#MAXCDE ; valid special code ? BHIS 10$ ; no, ignore it ADDW D1,D1 ; make index into word offset MOVW CTLTBL[~D1],D1 ; index address LEA A6,CTLTBL[~D1] ; of string CALL OUT.STRING ; go output it 10$: REST D1 ; restore registers RTN ; return ; Printer control string table ; CAUTION: Do not change the order of the string table. ; If the string is not implemented put a length of zero at the label. DEFINE STRING TAG WORD TAG-CTLTBL ENDM CTLTBL: STRING CHOME ; 00 return carriage home STRING MOVAHT ; 01 move to absolute horizontal tab STRING ROLUP ; 02 roll up a partial line STRING ROLDWN ; 03 roll down a partial line STRING NEGLF ; 04 output negative line feed STRING SPLPT0 ; 05 special print position 0 STRING SPLPT1 ; 06 special print position 1 STRING RIBSC1 ; 07 print in Secondary ribbon color 1 STRING RIBSC2 ; 08 print in Secondary ribbon color 2 STRING RIBSC3 ; 09 print in Secondary ribbon color 3 STRING RIBPRM ; 10 print in Primary ribbon color STRING FEDTR1 ; 11 select Feeder tray 1 STRING FEDTR2 ; 12 select Feeder tray 2 STRING FEDTR3 ; 13 select Feeder tray 3 STRING FEDTR4 ; 14 select Feeder tray 4 STRING FEDTGL ; 15 select Feeder tray 1 & then tray 2 STRING FEDEJT ; 16 select Feeder eject STRING USR1 ; 17 user function 1 STRING USR2 ; 18 user function 2 STRING USR3 ; 19 user function 3 STRING USR4 ; 20 user function 4 STRING RIBSC4 ; 21 print in Secondary ribbon color 4 STRING RIBSC5 ; 22 print in Secondary ribbon color 5 STRING RIBSC6 ; 23 print in Secondary ribbon color 6 STRING RIBSC7 ; 24 print in Secondary ribbon color 7 TBLEND: ; end of table MAXCDE=<" ;
BYTE $CR,$LF,0 ;
EVEN ;
200$: ;ASCII " " ;
BYTE $CR,$LF,0 ;
EVEN ;
;************
;* PDFONT *
;************
;Function: Set font
;
;Inputs: D1 - font letter or digit
PDFONT: RTN ; return
;************
;* PDPSIZ *
;************
;Function: Set Paper Size
;
;Inputs: D2 - page size in points
PDPSIZ: CMPW D2,PAGSIZ(A3) ; save page size as last time?
BNE 10$ ; no
RTN ; yes - do nothing and return
10$: MOVW D2,PAGSIZ(A3) ; set new page size
RTN ; return
;************
;* PDTMAR *
;************
;Function: Set Top Margin from value in D2
;
;Inputs: D2 contains the size of the top margin in points
PDTMAR: MOVW D2,TOPMGN(A3) ; set the top margin
RTN ; return
;************
;* PDLEFT *
;************
;Function: Set left paper offset
;
;Inputs: D2 - left paper offset in points
PDLEFT: MOV D2,D6 ; convert to
MUL D6,#100. ; centipoints
MOV D6,LFTOFF(A3) ; set left paper offset [255]
RTN ; return
;************
;* PDFSIZ *
;************
;Function: Set font size
;
;Inputs: D2 - font size in points
PDFSIZ: RTN ; return
;************
;* PDITAL *
;************
;Toggle italic style
PDITAL: XORW #F$ITA,FLAGS(A3) ; flip italic flag
BITW #F$ITA,FLAGS(A3) ;
BNE ITLON ;
;
ITLOFF: OUTSTR 100$ ;
RTN ;
100$: ASCIZ "" ;
EVEN ;
ITLON: OUTSTR 100$ ;
RTN ;
100$: ASCIZ "" ;
EVEN ;
RTN ; return
;************
;* PDFATR *
;************
;Function: Set font attributes directly
;
;Inputs: D2 - bit flags:
;
; PA$BLD=1 bold
; PA$UND=2 underscore
; PA$ITA=4 italic
; PA$SCR=10 screened
; PA$REV=20 reverse
; PA$DBL=40 double underscore
; PA$BAR=100 overbar
PDFATR:
;bold handling
PDFBLD: BITW #PA$BLD,D2 ; bold requested?
BNE PDFBON ; yes
PDFBOF: BITW #F$BLD,FLAGS(A3) ; is bold already off?
BEQ PDFUND ; yes
CALL BLDOFF ; no - turn it off
BR PDFUND ;
PDFBON: BITW #F$BLD,FLAGS(A3) ; is bold already on?
BNE PDFUND ; yes
CALL BLDON ; no - turn it on
;underscore handling
PDFUND: BITW #PA$UND,D2 ; underscore requested?
BNE PDFUON ; yes
PDFUOF: BITW #F$UND,FLAGS(A3) ; is underscore already off?
BEQ PDFRTN ; yes
CALL UNDOFF ; no - turn it off
BR PDFRTN ;
PDFUON: BITW #F$UND,FLAGS(A3) ; is underscore already on?
BNE PDFRTN ; yes
CALL UNDON ; no - turn it on
PDFRTN: RTN ; return
;************
;* PDMCHR *
;************
;Function: Move to character position D2
;
;Inputs: D2 - column number
PDMCHR: MOV D2,D6 ; copy column
DEC D6 ; subtract one
BMI 10$ ; negative - do nothing
BEQ 10$ ; zero - we are already there
;[171] MUL D6,#7200. ; convert column
;[171] CLR D7 ; get
;[171] MOVB PITCH(A3),D7 ; pitch
;[171] DIV D6,D7 ; divide by pitch
;[171] AND #177777,D6 ; D6 := size of a char * #columns
CLR D7 ; get size [171]
MOVW CHRSIZ(A3),D7 ; of a character [171]
MUL D6,D7 ; D6 := column * char_size in cpts [171]
ADD LFTOFF(A3),D6 ; add in left paper offset [255]
;; CALL TAB.CENTIPOINTS ; move there
10$: RTN ; return
;************
;* PDMLIN *
;************
;Function: Move to line
;
;Inputs: D2 - line to move to (AW 12-point lines)
PDMLIN: SAVE D2 ; save registers
PUSHW V.LOC(A3) ; save vertical location
CLR D1 ; set horizontal location to far left
MUL D2,#12. ; convert vertical to points
BCALL PDMOVE ; move to (0,D2)
POPW V.LOC(A3) ; restore vertical location
REST D2 ; restore registers
RTN ; return
;************
;* PDMOVE *
;************
;Function: Move to location indicated by points coordinates (D1, D2)
PDMOVE: SAVE D0-D2 ; save registers
BITW #F$UND,FLAGS(A3) ; are we underscoring?
BEQ 10$ ; no
CALL UNDOFF ; yes - turn off underscoring
10$: BITW #F$BLD,FLAGS(A3) ; are we bolding?
BEQ 20$ ; no
CALL BLDOFF ; yes - turn off bolding
20$:
;set vertical location to match D2 (points)
PDM.V: SAVE D1 ;
10$: CMMW V.LOC(A3),D2 ; are we at or past right spot?
BHIS 20$ ; yes
MOVW V.LOC(A3),D7 ;
ADDW V.SIZ(A3),D7 ;
CMPW D7,D2 ;
BHI 20$ ;
OUTSTR 100$ ;
CLRW CHARS(A3) ; no characters on current line.
;; MOVB #$CR,D1 ; output
;; FILOTB PTDDB(A3) ; carriage return
;; MOVB #$LF,D1 ; output
;; FILOTB PTDDB(A3) ; line feed
ADDW2 V.SIZ(A3),V.LOC(A3) ; update current location
CLR H.LOC(A3) ; [255]
MOVW #1,OUTCOL(A3) ; reset column
BR 10$ ; loop
20$: REST D1 ;
BR PDM.H ;
100$: ASCII " " ;
BYTE $CR,$LF,0 ;
EVEN ;
;set horizontal location to match D1 (points)
PDM.H: CLR D6 ; [255]
MOVW D1,D6 ;
;; CALL TAB.POINTS ;
PDMRTN: BITW #F$UND,FLAGS(A3) ; are we underscoring?
BEQ 10$ ; no
CALL UNDON ; yes - turn it back on
10$: BITW #F$BLD,FLAGS(A3) ; are we bolding?
BEQ 20$ ; no
CALL BLDON ; yes - turn it back on
20$: REST D0-D2 ; restore registers
MOVW D2,V.LOC(A3) ; agree with calling application
RTN ; return
;************
;* PDFTBL *
;************
;Function: Return index to font table
;
;Outputs: A6 - address of font table
PDFTBL: LEA A6,FONT.TABLE ; point A6 to font table
RTN ; return
;************
;* PDFSUB *
;************
;Function: Perform font substitution
;
;Inputs: D1 - font letter
;
;Outputs: D1 - substituted font letter (may or may not have changed)
PDFSUB: MOVB #'C,D1 ; everything goes to Courier
RTN ; return
;************
;* PDOTSC *
;************
;Function: Output special character
;
;Inputs: D1 - special character code (C$xxx)
PDOTSC: SAVE D1 ; save registers
LEA A6,SPCTBL ; index special character table
10$: MOVB (A6)+,D6 ; get spec. char. code
BEQ 20$ ; end of table
MOVB (A6)+,D7 ; get replacement code
CMPB D6,D1 ; match?
BNE 10$ ; no - loop back
MOVB D7,D1 ; yes - make replacement
20$: CALL PDCHR ; output character
REST D1 ; restore registers
RTN ; return
SPCTBL: BYTE C$NXB,32. ; non-exandable space
BYTE C$DEG,'o ; degree symbol
BYTE C$PAR,'P ; paragraph symbol
BYTE C$DAG,'t ; dagger
BYTE C$SEC,'s ; section symbol
BYTE C$CNT,'c ; cent sign
BYTE C$QTR,'q ; 1/4
BYTE C$HAF,'h ; 1/2
BYTE C$TM ,'t ; trademark symbol
BYTE C$CPY,'c ; copyright symbol
BYTE C$REG,'r ; registered symbol
BYTE C$STR,'* ; star
BYTE C$BLT,'o ; bullet
BYTE C$EMD,'- ; em dash
BYTE C$END,'- ; en dash
BYTE C$RTN,'< ; RETURN keycap
BYTE 0 ; ** end of table **
EVEN
;text sequence macro
DEFINE STR TEXT,SIZE
1$$: ASCIZ /TEXT/
BLKB SIZE-<.-1$$>
ENDM
;***********
;* PDPCH *
;***********
;Return index to printer characeristics block in A6
PDPCH: LEA A6,PCH ;
RTN
PCH: STR
" ;
BYTE $CR,$LF,0 ;
EVEN ;
;************
;* PDMTOF *
;************
;Function: Move to Top of Form and setup for new page
PDMTOF: SAVE D1 ; save registers
MOVB #$FF,D1 ; load form feed
FILOTB PTDDB(A3) ; output it
MOVW #1,OUTCOL(A3) ; reset column
CLR H.LOC(A3) ; clear horizontal position [255]
CLRW V.LOC(A3) ; clear vertical position
REST D1 ; restore registers
RTN ; return
;************
;* PDPSON *
;************
;Function: Enable proportional spacing
;
;Inputs: WRDSPC(A3) - #points to advance after each space
; SPCCNT(A3) - number of spaces in line
PDPSON: ORW #F$PRO,FLAGS(A3) ;
FFTOL WRDSPC(A3),D7 ;
MUL D7,#100. ;
MOVW D7,SPCSIZ(A3) ;
CLRW SPCACC(A3) ;
RTN ;
;************
;* PDPSOF *
;************
;Function: Disable proportional spacing
PDPSOF: ANDW #^C