CHRS ASM({CHRS COMeCHRS HLP- ; ; CHRS.ASM 02/24/83 J B PALMER ; WILL SEND HEX CHARS IN COMMAND TAIL TO PRINTER ; ; 03/31/84 - LEE BRADLEY - MAINTAINED FUNCTION TABLE ; WBOOT EQU 0 BDOS EQU 5 DFB EQU 80H LST EQU 5 PSTR EQU 9 ORG 100H CHRS: JMP START HELMSG: ; EXAMPLES FOR MX-80 DB 13,10,'CHRS.COM 3/31/84',13,10 DB 13,10 DB 'CHRS 09 => HORIZONTAL TAB',13,10 DB 'CHRS 0A => LINE FEED',13,10 DB 'CHRS 0C => FORM FEED',13,10 DB 'CHRS 0D => CARRIAGE RETURN',13,10 DB 'CHRS 0F => COMPRESSED',13,10 DB 'CHRS 1B 2D 01 => UNDERLINE',13,10 DB 'CHRS 1B 30 => LINE SPACING TO 1/8"',13,10 DB 'CHRS 1B 34 => ITALIC',13,10 DB 'CHRS 1B 38 => IGNORE PAPER OUT SENSOR',13,10 DB 'CHRS 1B 40 => RESET ALL',13,10 DB 'CHRS 1B 45 => EMPHASIZED',13,10 DB 'CHRS 1B 47 => OVERSTRIKE',13,10 DB 'CHRS 1B 4E 02 => SKIP PERF',13,10 DB 'CHRS 1B 57 01 => DOUBLE WIDE',13,10 DB 13,10 DB '$' HELP: LXI D,HELMSG MVI C,PSTR CALL BDOS JMP WBOOT START: LXI SP,DFB LXI H,DFB ; DEFAULT BUFFER MOV C,M ; NUMBER OF BYTES INX H SHLD PTR ; START OF COMMAND TAIL MOV A,C CPI 3 ; AT LEAST 3 BYTES JC HELP ; SHORT OR MISSING TAIL LOOP: MOV A,C ORA A ; TEST FOR END JZ ALLOK CALL GETBYTE CALL LSTOUT JMP LOOP PTR: DW 0 ALLOK: LHLD PTR MVI M,'$' MVI C,PSTR LXI D,ISENT CALL BDOS MVI C,PSTR LXI D,DFB + 2 CALL BDOS MVI C,PSTR LXI D,TOPRINT CALL BDOS JMP WBOOT ; WARM BOOT ISENT: DB 'I SENT $' TOPRINT: DB ' TO PRINTER.$' LSTOUT: PUSH B MVI C,LST MOV E,A CALL BDOS POP B RET GETBYTE: LHLD PTR MOV A,M CPI ' ' ; IF SPACE, SKIP JNZ GETBY1 INX H DCR C JM ERROR ; WENT TOO FAR ! RZ ; ALLOW ONE LAST SPACE. GETBY1: CALL GETNIBL RAL RAL RAL RAL MOV B,A CALL GETNIBL ORA B SHLD PTR RET GETNIBL: MOV A,M INX H DCR C JM ERROR SUI '0' JC ERROR CPI 10 CMC RNC ; WAS < 10 SUI 07 ; A TO 10, F TO 15 JC ERROR ; ERROR IF CARRY CPI 16 CMC RNC ; ERROR IF CARRY ERROR: LXI D,ERRMESS MVI C,PSTR CALL BDOS JMP WBOOT ; WARM BOOT ERRMESS: DB 'INVALID CODE ! $' END CHRS  CHRS.COM 3/31/84 CHRS 09 => HORIZONTAL TAB CHRS 0A => LINE FEED CHRS 0C => FORM FEED CHRS 0D => CARRIAGE RETURN CHRS 0F => COMPRESSED CHRS 1B 2D 01 => UNDERLINE CHRS 1B 30 => LINE SPACING TO 1/8" CHRS 1B 34 => ITALIC CHRS 1B 38 => IGNORE PAPER OUT SENSOR CHRS 1B 40 => RESET ALL CHRS 1B 45 => EMPHASIZED CHRS 1B 47 => OVERSTRIKE CHRS 1B 4E 02 => SKIP PERF CHRS 1B 57 01 => DOUBLE WIDE $ 1!N#"yy4+*6$   I SENT $ TO PRINTER.$_*~ C# kSGS"~# k0k ?k?v INVALID CODE ! $Background on CHRS What CHRS does How CHRS works :Background on CHRS CHRS appeared first to me on the back page of Sheepshead Software's catalog of Public Domain software. It is written by J B Palmer. I typed it in and expanded the help menu a bit. It is short, useful and a nice example of CP/M assembly language programming. Lee R. Bradley 24 East Cedar St. Newington, CT 06111 (203) 666-3139 :What CHRS does CHRS sends hex characters in a command tail to your printer. You can put your printer in italics mode, overstrike mode etc. By just typing CHRS alone, you will get a help menu of all the typical control characters. :How CHRS works CHRS retrieves the contents of the default buffer which holds the command tail and converts each pair of hex characters into a binary byte and sends this byte to the list device. At the end it tells you what it sent. An error message is given if an invalid code is sent.  St.Newington, CT 06111(203) 666-3139