;*************************************************************************** ;* * ;* Plain (Text Only) Printer Driver * ;* * ;*************************************************************************** SEARCH SYS SEARCH SYSSYM COPY PDVSYM OBJNAM .PDV VMAJOR=1. VMINOR=0. VEDIT=100. ;Edit History: ;[100] 26 May 1988 ; Created from MISC.M68 1.1(108). /DFP 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. ; PDV: PHDR -1,0,PH$REE!PH$REU LWORD 0 ; nothing fancy on this printer JMP PDINI ; PDINI, initialize printer JMP IGNORE ; PDCLS, shut down printer JMP PDCHR ; PDCHR, output a character in D1 JMP PDCTL ; PDCTL, output control string indexed by D1 JMP PDSPL ; 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 IGNORE ; PDPSON, enable proportional JMP IGNORE ; PDSOF, disable proportional JMP IGNORE ; PDUNDR, toggle underscore JMP IGNORE ; PDBOLD, toggle bold JMP PDSTRK ; PDSTRK, toggle strikeout JMP IGNORE ; PDBAR, toggle over-bar JMP IGNORE ; PDSLPI, set Lines Per Inch JMP IGNORE ; PDSHMI, set Horizontal Motion Index JMP IGNORE ; PDSCPI, set Characters Per Inch JMP PDSTM ; 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 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 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 PAGE ;************************ ;* PDSPL * ;************************ ; Output a control string & then the byte in D2 ; String number is in D1. ; PDSPL: BCALL PDCTL ; output the string MOVB D2,D1 ORB #^H80,D1 ; make sure it gets thru TRMSER FILOTB PTDDB(A3) ; output it IGNORE: RTN ; just return to caller of .PDV PAGE ;************************ ;* PDCTL * ;************************ ; Output a control string. ; String index is in D1 ; PDCTL: CMPB D1,#MAXCDE ; valid special code ? BHIS 99$ ; no, ignore it [108] ADDW D1,D1 ; make index into word offset MOVW CTLTBL[~D1],D1 ; get string offset LEA A6,CTLTBL[~D1] JMP STROUT ; go output it 99$: RTN ; 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 TBLEND: ; end of table MAXCDE = </2.> ; maximum special code PAGE ;************************ ;* PDCHR * ;************************ ; Output the character in D1 ; PDCHR: FILOTB PTDDB(A3) ADDW #1,CURCOL(A3) ; advance to next column RTN PAGE ;************************ ;* STROUT * ;************************ ; Output string indexed by A6 to DDB indexed by A3 ; STROUT: SAVE A0,D1,D2 ; save registers MOV A6,A0 CLR D2 MOVB (A0)+,D2 ; get string length BR 20$ ; and enter loop at end 10$: MOVB (A0)+,D1 ; get byte from string FILOTB PTDDB(A3) ; output it 20$: DBF D2,10$ ; loop until all characters output REST A0,D1,D2 ; restore registers RTN PAGE ;************************ ;* PDINI * ;************************ ; Initialize the printer ; PDINI: MOVW #-1,HMISAV(A3) ; no HMI yet MOVW #-1,LPISAV(A3) ; no LPI yet MOVW #-1,CPISAV(A3) ; no CPI yet MOVW #-1,TPMSAV(A3) ; no top margin yet MOVW #-1,LPOSAV(A3) ; no left paper offset yet CLRW CURCOL(A3) ; at column 0 CLR CURLIN(A3) ; at start of page RTN ;************************ ;* PDCLS * ;************************ ; Shut down the printer ; PDCLS: ; not needed since nothing is altered PAGE ;************************ ;* PDSTM * ;************************ ; Set Top Margin from value in D2 ; D2 contains the number of lines required in the Top Margin ; PDSTM: MOVW D2,TPMSAV(A3) ; save top margin value RTN ;************************ ;* PDMTM * ;************************ ; Move to Top Margin ; PDMTM: PUSHW D2 ; save register MOVW TPMSAV(A3),D2 ; get offset value BCALL PDLF ; go output line feeds POPW D2 RTN ;************************ ;* PDLF * ;************************ ; Output Line feeds per count in D2 ; PDLF: PUSHB D1 BR 15$ ; and enter loop at end 10$: MOVB #$CR,D1 ; output a carriage return [103] FILOTB PTDDB(A3) ; [103] MOVB #$LF,D1 ; then a line feed [103] FILOTB PTDDB(A3) ; output a single space ADD #2,CURLIN(A3) ; bump number of 1/2 lines 15$: DBF D2,10$ ; and loop until all done POPB D1 RTN PAGE ;************************ ;* PDSLPO * ;************************ ; Set Left Paper Offset ; D2 contains the number of 1/10 inch units required ; PDSLPO: MOVW D2,LPOSAV(A3) ; save left paper offset RTN ;************************ ;* PDMLPO * ;************************ ; Move to Left Paper Offset ; PDMLPO: SAVE D1,D2 MOVW LPOSAV(A3),D2 ; get offset value MOVW D2,STKCOL(A3) ; set strikeout column in case it is on [107] MOVB #$SPC,D1 ; get a space BR 15$ ; and enter loop at end 10$: ADDW #1,CURCOL(A3) ; bump current column FILOTB PTDDB(A3) ; output a single space 15$: DBF D2,10$ ; and loop until all done REST D1,D2 RTN PAGE ;************************ ;* PDSLPP * ;************************ ; Set lines per page ; D2 contains the form length in number of lines ; PDSLPP: MOVW D2,LPPSAV(A3) ; save for later RTN PAGE ;************************ ;* PDSLSP * ;************************ ; Set line spacing ; D2 contains the number of 1/2 lines ; PDSLSP: MOVW D2,LSPSAV(A3) ; save for later RTN PAGE ;************************ ;* PDMTOF * ;************************ ; Move to Top of Form and setup for new page ; PDMTOF: CLR D7 MOVW LPPSAV(A3),D7 ; get lines per page ADD D7,D7 ; convert to number of 1/2 lines CMP D7,CURLIN(A3) ; are we already at new page ? BEQ 10$ ; yes, don't output a Form Feed PUSHB D1 ; save register MOVB #$FF,D1 FILOTB PTDDB(A3) ; output a Form Feed POPB D1 ; restore register 10$: CLR CURLIN(A3) ; at start of page RTN PAGE ;************************ ;* PDMNLN * ;************************ ; Move to Next Line and setup for new line ; PDMNLN: SAVE D1,D2 CALL STKTST ; go output strikout (if any) ;[105] MOVB #$CR,D1 ;[105] FILOTB PTDDB(A3) ; output the CR CLRW CURCOL(A3) ; back to column 0 MOVW LSPSAV(A3),D2 ; get current line spacing ADDW #1,D2 ; round it up LSRW D2,#1 ; convert to number of whole LFs BR 20$ ; enter at end of loop 10$: ADD #2.,CURLIN(A3) ; bump current line number by full line MOVB #$CR,D1 ; output a carriage return [105] FILOTB PTDDB(A3) ; [105] MOVB #$LF,D1 ; [105] FILOTB PTDDB(A3) ; output the LF 20$: DBF D2,10$ ; and loop until done REST D1,D2 RTN PAGE ;************************ ;* PDSTRK * ;************************ ; Toggle strikeout ; PDSTRK: BCHG #FM%STK,FM.FLG(A3) ; toggle strikeout flag BNE STKOUT ; and go do it if end of field MOVW CURCOL(A3),STKCOL(A3) ; or set field start MOVB D1,STKCHR(A3) ; save strikeout character RTN ; Test for strikeout and output it if true ; STKTST: BTST #FM%STK,FM.FLG(A3) ; strikeout active ? BEQ STKOTX ; no, just return ; Output everything up to here & return the carriage home ; STKOUT: SAVE D1,D2 MOVB #$CR,D1 ; get a carriage return FILOTB PTDDB(A3) ; and output it ; Output leading spaces until start of strikeout field ; MOVW STKCOL(A3),D2 ; get start of strikeout field MOVB #$SPC,D1 ; get a space BR 15$ ; and enter loop at end 10$: FILOTB PTDDB(A3) ; output a space 15$: DBF D2,10$ ; loop until start of strikeout field ; Output the required number of strikeout ; MOVW CURCOL(A3),D2 ; get field end SUBW STKCOL(A3),D2 ; and calculate field length MOVB STKCHR(A3),D1 ; get strikeout character BR 25$ ; and enter loop at end 20$: FILOTB PTDDB(A3) ; output an strikeout 25$: DBF D2,20$ ; loop until end of strikeout field REST D1,D2 STKOTX: CLRW STKCOL(A3) RTN PAGE ;************************ ;* PDOVRP * ;************************ ; Setup to overprint the last character ; PDOVRP: SAVE D1,D2 MOVB #$CR,D1 ; get a carriage return FILOTB PTDDB(A3) ; and output it ; Output leading spaces until positioned over last character ; MOVW CURCOL(A3),D2 ; get start position of last char. BEQ 5$ SUBW #1,D2 ; adjust to actual column number MOVW D2,CURCOL(A3) 5$: MOVB #$SPC,D1 ; get a space BR 15$ ; and enter loop at end 10$: FILOTB PTDDB(A3) ; output a space 15$: DBF D2,10$ ; loop until positioned over last char REST D1,D2 RTN PAGE ;********************* ;* Carriage Movement * ;********************* ; Move to Absolute Horizontal Tab ; MOVAHT: BYTE 0 ; Return carriage home ; CHOME: BYTE 1. ; string length BYTE $CR PAGE ;****************** ;* Paper Movement * ;****************** ; Roll up a partial line (positive) ; ROLUP: BYTE 0. ; string length ; Roll down a partial line (negative) ; ROLDWN: BYTE 0. ; string length ;Output a negative line feed ; NEGLF: BYTE 0. ; string length PAGE ;************************** ;* Miscellaneous Commands * ;************************** ; Print in Secondary ribbon color 1 ; RIBSC1: BYTE 0. ; string length ; Print in Secondary ribbon color 2 ; RIBSC2: BYTE 0. ; string length ; Print in Secondary ribbon color 3 ; RIBSC3: BYTE 0. ; string length ; Print in Primary ribbon color (black) ; RIBPRM: BYTE 0. ; string length ; Output character at special print position 0 ; SPLPT0: BYTE 0. ; string length ; Output character at special print position 1 ; SPLPT1: BYTE 0. ; string length PAGE ;************************ ;* Cut Sheet Feeder * ;************************ ; Select feeder tray 1 ; FEDTR1: BYTE 0. ; string length ; Select feeder tray 2 ; FEDTR2: BYTE 0. ; string length ; Select feeder tray 3 ; FEDTR3: BYTE 0. ; string length ; Select feeder tray 4 ; FEDTR4: BYTE 0. ; string length ; Select feeder tray 1 & then tray 2 thereafter ; FEDTGL: BYTE 0. ; string length ; Select feeder eject ; FEDEJT: BYTE 0. ; string length PAGE ;************************** ;* Special User Functions * ;************************** ; Output user function 1 ; USR1: BYTE 0. ; string length ; Output user function 2 ; USR2: BYTE 0. ; string length ; Output user function 3 ; USR3: BYTE 0. ; string length ; Output user function 4 ; USR4: BYTE 0. ; string length EVEN ; module must end on word boundary END .