SUBTTL QUM driver -- PPDATA macro expansion PRINTX %PLTQUM not finished PPDATA (QUM) QUMNAM: DEC 830 ASCII /AJ830/ ;Anderson Jacobsen ASCII /GENCO/ ;GENCOM ASCII /QUME/ ;QUME ASCII /XEROX/ ;XEROX ASCII /DIABL/ ;DIABLO SUBTTL QUM driver -- Daisy-wheel printers ; These routines drive the QUME, XEROX, DIABLO, GENCOM, or AJ830 ; hard-copy terminals. Plotting is done in 1/48 inch increments ; vertically and 1/60 inch increments horizontally. The "pen" is the ; period character, struck so as to make a "continuous" line. COMMENT & Char GENCOM DIABLO ^@ NUL ^A SOH ^B STX ^C ETX Sends a ^F when buffer empty ^D EOT Sends a ^F when buffer is empty ^E ENQ Reverse linefeed ^F ACK Sent when buffer is empty Sent when buffer is empty ^G BEL Bell Bell ^H BS Backspace, cancels an escape Backspace (can be reverse) ^I HT Horizontal tab Horizontal tab ^J LF Linefeed, reverse after an escape for both ^K VT Vertical tab ^L FF Formfeed, reverse after an escape for both ^M CR Carraige return Carriage return ^W CAN Prints "not" sign ^Y EM Unlocks keyboard, locked by $O ^Z SUB Print without spacing ^[ ESC ESCAPE ESCAPE ^\ GS Disable escapes ^] GS Print "cent" ^^ RS Enable escapes (toggle) ^_ US SPACE Space Space (can be reverse) $BS Nothing (cancelled ESCAPE) $HT Absolute horizontal tab (1 char, 1-127) $VT Absolute vertical tab (1 char, 1-66) $LF Negative linefeed Negative linefeed $FF Negative top of form Negative top of from $RS Vertical motion index (1 char) $US Horizontal motion index (1 char) $@ Clear vertical tab $A Enable lowercase Red ribbon $B Subscript Black ribbon $C Clear auto linefeed $D Enable auto linefeed Negative half linefeed $E 10 cpi, 6 lpi $F 12 cpi, 8 lpi $G $H Absolute horizontal tab (3 digits) $I Set form length (3 digits) $J 6 lpi $K 8 lpi $L Single space $M Toggle auto linefeed $N Set vertical tab $O Lock keyboard, unlocked by ^Y $P Double space $Q Set page length (3 digits) $R $S Superscript $T Set top of form $U Disable lower case Half linefeed $V Absolute vertical tab (3 digits) $W Toggle proportional text $X Set horizontal motion index (4 digits, leading minus) $Y Set vertical motion index (4 digits, leaging minus) $Z $0 Negative half linefeed Set right margin $1 Set tab stop Set tab stop $2 Clear tab stop Clear all tabs $3 Clear all tab stops Graphics on $4 Toggle basic plot mode Graphics off $5 Toggle true plot mode Forward print $6 Set left margin Backward print $7 Set right margin $8 Clear both margins Clear single tab $9 Half linefeed Set left margin $: Disable ribbon lift $; Enable ribbon lift $.lt. Reset $= Disable auto CRLF $.gt. Call user program $? GENCOM TRUE PLOT mode In TRUE PLOT mode, the characters 0 through ? set the quadrant for movement, and whether to move in single or double increments. single down 2 ! single down 3 single up 6 ! single up 7 double down : ! double down ; double up .gt. ! double up ? ----------------+----------------- single down 1 ! single down 0 single up 5 ! single up 4 double down 9 ! double down 8 double up = ! double up .lt. Alphabetical characters @ through DEL move in TRUE PLOT mode. The low order 3 bits specify the Y increments, the next 3 bits specify the X increment. & ;End of COMMENT SUBTTL QUM driver -- QUMMOV DIANAM: ASCII /QUME/ ;Data for PLOTS ASCII /DIABL/ ASCII /GENCO/ QUMLEN==.-QUMNAM PPDATA (QUM) ;Expand data area ; Subroutine QUMMOV (QUMDWN) - move the pen with the pen up (down) ; Calling sequence: ; DMOVE X,(delta X of the movement) ; PUSHJ P,QUMMOV ;For up (or PUSHJ P,QUMDWN ;For down) ; *return* QUMMOV: TLOA T1,1UP ;Set for pen up QUMDWN: TLZ T1,1UP ;Set for pen down SKIPN X ;Test for X = 0 JUMPE Y,SLADON ; and Y = 0, do not move MOVE T2,RMOV ;Get the chars to move right SKIPGE X ;Check the X direction MOVE T2,LMOV ;We go left MOVEM T2,XMOV ;Save them MOVE T2,UMOV ;Get the chars to move up SKIPGE Y ;Check the Y direction MOVE T2,DMOV ;We go down MOVEM T2,YMOV ;Save them MOVMS T2,X ;Get abs of X MOVMS T3,Y ;Get abs of Y MOVE T1,X ;Preset the counter SUB T1,Y ; to (X-Y)/2 ASH T1,-1 ; ... CAIN X,1 ;Special case X=1, Y=0 JUMPE T1,OUTX ; since 1/2 is not positive SLA: TLNN T1,1UP ;Is the pen up? OUTCHR DOT ;No, make a mark JUMPG T1,OUTX ;Send X movement if positive OUTSTR YMOV ;Output movement ADD T1,X ;Set count for X movement next SOJG T3,SLA ;Loop for all Y increments JUMPLE T2,SLADON ;Done if both X and Y counts are zero OUTX: OUTSTR XMOV ;Output the X movement SUB T1,Y ;Set count for Y movement next SOJG T2,SLA ;Loop for all X increments JUMPG T3,SLA ;Not done until both X and Y are both zero SLADON: TLNN T1,1UP ;Is the pen up? OUTCHR DOT ;No, make a mark POPJ P, ;Return to caller XMOV: 0 ;Characters used to move in the X direction YMOV: 0 ;Characters used to move in the Y direction DOT: PEN1 ;Printing character IFN FTGEN,< CLRSCN: BYTE (7)CR,FF,ESCOFF,ESCON,PLUSY,PLUSY,PLUSY,0 ;New page, up 3 lines HOME: BYTE (7)ESC,PLOTON,CR,FF,0 ;Turn off plotting, start a new page ORIGIN: BYTE (7)ESCOFF,ESCON,ESC,PLOTON,0 ;Enable escapes, turn on plotting ANMODE==ORIGIN ;Alphanumeric mode, same as ORIGIN (toggle plot off) PLTMOD==ORIGIN ;Turn on plotting without moving UMOV: BYTE (7)PLUSY ;Move up > ;End of IFN FTGEN IFE FTGEN,< CLRSCN: BYTE (7)CR,FF,ESC,LF,ESC,LF,ESC,LF,0 ;New page, up 3 lines HOME: BYTE (7)ESC,PLOTOF,CR,FF,0 ;Start a new page ORGIN: BYTE (7)ESC,PLOTON,0 ;Turn on plotting UMOV: BYTE (7)ESC,MINUSX ;Move up > ;End of IFE FTGEN ;Common to both DIABLO and GENCOM BEEP: BYTE (7)7,0 ;Control-G LMOV: BYTE (7)MINUSX ;Move left RMOV: BYTE (7)PLUSX ;Move right DMOV: BYTE (7)MINUSY ;Move down LITQUM: LIT ;End of PLTQUM.MAC