.COMMENT \ GEMSET Rev. 1.0 by P. L. Kelley ******************************* This version is set up for a Gemini-10 printer. 1. Home printhead command removed. 2. Carriage return and linefeed not sent to printer after commands. 3. Proportional spacing command added. 4. 12 cpi command added. 5. Start column command added. 6. Lines per inch command added. 7. Formfeed command added. 8. Optional printer status checking added. BE SURE AND CHECK THE SETTING OF LSTATUS BELOW FOR YOUR SYSTEM. 9. Header line position command added. 10. Eliminated stack imbalance and improper use of PRINT##. July 28, 1984 ***************************************************************************** MXSET Rev. 1.2 by Simon J. Ewins, Toronto, Ontario, Canada. *********************************************************** This program will set/reset all of the major functions of the Epson MX-80 printer. The program uses Z80 Zilog mnemonics and calls are made to Richard Conn's excellent SYSLIB.REL file. Microsoft's M80 macro assembler is needed for assembly of this file as well as the SYSLIB file. June 28, 1983. Toronto, Ontario. ****************************************************************************** \ TRUE EQU -1 FALSE EQU NOT TRUE ; ;Set the following to TRUE if BIOS printer status checking is implimented. LSTATUS EQU FALSE ; .Z80 ASEG ORG 100H ; START0: LD SP,STACK CALL PRINT## DB 13,10,10 DB 'GEMSET Rev. 1.0 by P. L. Kelley -- 07/28/84',13,10 DB 'Based on MXSET Rev. 1.2 by Simon J. Ewins -- 06/28/83',0 START: CALL PRINT## DB 13,10,10 DB 'OPTIONS:',13,10,10 DB 'A - Set printer to DEFAULTS',13,10 DB 'B - Turn ON UNDERLINE mode -- use A to turn OFF',13,10 DB 'C - Turn ON UNIDIRECTIONAL mode -- use A to turn OFF',13,10 DB 'D - Set COLUMNS to start and end',13,10 DB 'E - Turn ON PERFORATION SKIPOVER',13,10 DB 'F - Turn OFF PERFORATION SKIPOVER',13,10 DB 'G - Turn ON PAPER-END DETECTOR',13,10 DB 'H - Turn OFF PAPER-END DETECTOR',13,10 DB 'I - Select CHARACTER FONTS',13,10 DB 'J - Set LINES-PER-INCH',13,10 DB 'K - Set HEADER LINE position',13,10 DB 'L - Do PRINT TEST',13,10 DB 'M - Set paper to TOP-OF-FORM',13,10 DB '^C - Quit to CP/M',13,10,10,0 ; IF LSTATUS LD A,13 CALL LOUT## LD HL,200 LSTSLP: DEC HL LD A,H OR L JP NZ,LSTSLP LD HL,(1) LD B,0 LD C,2AH ADD HL,BC LD (LSTST+1),HL LSTST: CALL $-$ OR A JP NZ,LSTOK CALL PRINT## DB '--> Put printer on-line! <--',13,10,10,7,0 ENDIF ;LSTATUS ; LSTOK: CALL PRINT## DB 'Enter your choice: ',0 LD A,1 CALL BBLINE## LD A,(HL) SUB 'A' CP 'N'-'A' JP NC,INVAL ADD A,A LD HL,CALTBL LD B,0 LD C,A ADD HL,BC LD E,(HL) INC HL LD D,(HL) EX DE,HL LD BC,START PUSH BC JP (HL) INVAL: CALL PRINT## DB 13,10,10,'--> Invalid Command! <--',7,0 JP START ; CALTBL: DW LA DW LB DW LC DW LD DW LE DW LF DW LG DW LH DW LI DW LJ DW LK DW LL DW LM ; LA: LD A,1 ;Set printer to defaults LD (SRTCOL),A LD A,80 LD (ENDCOL),A CALL ESC LD A,64 CALL LOUT## RET ; LB: CALL ESC ;Turn on underline mode LD A,45 CALL LOUT## LD A,1 CALL LOUT## RET ; LC: CALL ESC ;Turn on unidirectional LD A,85 CALL LOUT## LD A,1 CALL LOUT## RET ; LD: CALL PRINT## ;Set column length DB 13,10,10,'Column length can be up to: ',13,10 DB ' <80> when in normal or emphasized mode.',13,10 DB ' <132> when in condensed mode.',13,10 DB ' <40> when in enlarged mode.',13,10 DB ' <66> when in enlarged-condensed mode',13,10,10 DB 'Enter starting column: ',0 LD A,0 CALL BBLINE## CALL EVAL10## PUSH AF LD HL,132 CALL COMPHD## POP BC JP C,LD LD A,B CP 0 JR Z,LD1 LD (SRTCOL),A PUSH AF CALL ESC LD A,77 CALL LOUT## POP AF CALL LOUT## LD1: CALL PRINT## DB 13,10,'Enter ending column: ',0 LD A,0 CALL BBLINE## CALL EVAL10## PUSH AF LD HL,132 CALL COMPHD## POP BC JP C,LD1 LD A,(SRTCOL) LD C,A LD A,B CP 0 JR Z,LDCHK CP C JR C,LDERR LD (ENDCOL),A PUSH AF CALL ESC LD A,81 CALL LOUT## POP AF CALL LOUT## RET LDCHK: LD A,(ENDCOL) CP C RET NC LDERR: CALL PRINT## DB 13,10,'Ending column too small, try again!',0 JP LD1 ; LE: CALL PRINT## ;Turn on perf. skip-over DB 13,10,10,'Enter number of lines to skip over perforation: ',0 LD A,0 CALL BBLINE## CALL EVAL10## PUSH AF LD HL,66 CALL COMPHD## POP BC JP C,LE LD A,B CP 0 RET Z PUSH AF CALL ESC LD A,78 CALL LOUT## POP AF CALL LOUT## RET ; LF: CALL ESC ;Turn off perf. skip-over LD A,79 CALL LOUT## RET ; LG: CALL ESC ;Turn on paper-end detector LD A,57 CALL LOUT## RET ; LH: CALL ESC ;Turn off paper-end detector LD A,56 CALL LOUT## RET ; LI: CALL PRINT## ;Choose alternate fonts DB 13,10,10 DB ' 1: Set italics ON',13,10 DB ' 2: Set italics OFF',13,10 DB ' 3: Set emphasized ON',13,10 DB ' 4: Set emphasized OFF',13,10 DB ' 5: Set double print ON',13,10 DB ' 6: Set double print OFF',13,10 DB ' 7: Set 10 CPI',13,10 DB ' 8: Set 12 CPI',13,10 DB ' 9: Set 17 CPI',13,10 DB '10: Set proportional spacing ON -- ' DB 'use option A to turn OFF',13,10 DB '11: Set enlarged ON (ignores linefeeds) -- ' DB 'use option A to turn OFF',13,10,10 DB 'Enter your choice: ',0 LD A,0 CALL BBLINE## CALL EVAL10## PUSH AF LD HL,11 CALL COMPHD## POP BC JP C,LI LD A,B CP 0 RET Z CP 11 JR NZ,LIA CALL ESC LD A,87 CALL LOUT## LD A,1 CALL LOUT## RET LIA: CP 10 JP NZ,LI1 LIB: CALL PRINT## DB 13,10,'Enter character spacing (1-6) :',0 LD A,0 CALL BBLINE## CALL EVAL10## PUSH AF LD HL,6 CALL COMPHD## POP BC JP C,LIB LD A,B CP 0 JP Z,LIB PUSH AF CALL ESC LD A,90 CALL LOUT## POP AF CALL LOUT## RET DATA: DB 52,53,69,70,71,72,66,66,66 LI1: DEC A PUSH AF LD HL,DATA LD B,0 LD C,A ADD HL,BC LD A,(HL) CALL ESC CALL LOUT## POP AF SUB 6 CP 3 RET NC INC A CALL LOUT## RET ; LJ: CALL PRINT## ;Set lines per inch DB 13,10,10,'Enter number of lines per inch (1-6): ',0 LD A,0 CALL BBLINE## CALL EVAL10## PUSH AF LD HL,6 CALL COMPHD## POP BC JP C,LJ LD A,B CP 0 RET Z LD HL,LPITBL-1 LD B,0 LD C,A ADD HL,BC LD A,(HL) PUSH AF CALL ESC LD A,51 CALL LOUT## POP AF CALL LOUT## RET LPITBL: DB 144,72,48,36,29,24 ; LK: CALL PRINT## ;Set header line position DB 13,10,10,'Enter header line position (1-16): ',0 LD A,0 CALL BBLINE## CALL EVAL10## PUSH AF LD HL,16 CALL COMPHD## POP BC JP C,LK LD A,B CP 0 RET Z PUSH AF CALL ESC LD A,82 CALL LOUT## POP AF CALL LOUT## RET ; LL: CALL LPRINT## ;Print test DB 13,10 DB 'ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz',13,10 DB "1234567890-=['\;,./",'!@#$%^&*()_+]"|:<>?',13,10,0 RET ; LM: LD A,12 ;Top-of-form CALL LOUT## RET ; ESC: PUSH AF LD A,27 CALL LOUT## POP AF RET ; SRTCOL: DB 1 ENDCOL: DB 80 DS 100 STACK: DS 2 ; END