;PTC2JA.CO sends a .DO file to LaserJet ;printer in two columns. ;for T200 6/04/2004 (c)RHPigford ;Runs at 60000 ;Becomes PTC2JA.CO with offset F: ; activated for ALTLCD opn. ; Assemble at 60000. Then CALL60000 frm ; BASIC to make it load to ALTLCD. ; Then SAVEM"PTC2JA",63572,63850,0 ;Upon entry, HL contains RAM addr ;of first byte of .DO text. ;Compr print, 1/8" line spacing ;PL = 72 lines ;Col Width = 40 in each ; Column 1 Column 2 ; LM=18 LM=73 ;First page = #1 ; ;Registers used to hold counters ; D=col cnt 0->3 E=Page cnt '1' + ; B=Chr cnt40->0 C=Line cnt 71->0 ; T200 M100 TOPRT: EQU 33993 ;27967 BEEP: EQU 20293 ;16937 BLKMOV: EQU 33558 ;27611 ALTLCD: EQU 63572 ;64704 PGMORG EQU 60000 PROGRM: EQU PGMORG+3 ;F: EQU 0 ;offset for himem F: EQU ALTLCD-PROGRM ;for altlcd* ;==================================== ORG PGMORG JMP MOVIT ;* ENTRY: SHLD RAMADR+F ;save RAM addr LXI H,FONT+F;font & line spacng CALL LJCMD+F ;set compr font MVI D,2 ;col 2 counter 1>0 MVI E,48 ;48=ascii val of 0 CALL NEWPG+F ;==== start print loop === STRCOL: MVI C,71 ;no of print lns/pg STRROW: MVI B,40 ;no of chrs/line PRINT: LHLD RAMADR+F MOV A,M ;get a chr to print INX H ;next chr in .DO file SHLD RAMADR+F CPI 26 ;EOF? JZ FINISH+F;last thing printed CPI 13 JZ ENDLIN+F CALL TOPRT DCR B ;chr cnt 41 to 0 JNZ PRINT+F;keep going until 0 CR: MVI A,13 ;send CR for new line CALL TOPRT LF: MVI A,10 ;send LF for new line CALL TOPRT DCR C ;line count JNZ STRROW+F ;start another row ;if line cnt not to 0 DCR D ;done second col? JZ FF+F ;send FF , reset D=1 CALL COL2+F ;no. do col 2 now JMP STRCOL+F ; ==== end print loop ==== ; NEWPG: MOV A,E INR A ;ready for next page # MOV E,A STA PGNO+F LXI H,FDCURS+F ;prt FN, DT, Pg# CALL LJCMD+F CALL RSMGN+F LXI H C1MGNS+F ;mgs & curs CALL LJCMD+F RET ; COL2: CALL RSMGN+F LXI H,C2MGNS+F ;mgns & curs CALL LJCMD+F ;continue on below RET ; RSMGN: MVI A,27 CALL TOPRT MVI A,'9';reset mgns 2 logic pg CALL TOPRT RET ; ENDLIN INX H ;pass over lf=10 in RAM SHLD RAMADR+F JMP CR+F ; FONT: DB 27,'(10U' DB 27,'(s0p16.66h8.5v0s0b0T' DB 27,'&l8D' ;1/8" ln spacing DB 255 ;compr type ; LJCMD: MOV A,M ;print strings to LJ CPI 255 RZ CALL TOPRT INX H JMP LJCMD+F ; FF: MVI A,12 ;form feed - new page CALL TOPRT CALL NEWPG+F MVI D,2 ;reset col cntr JMP STRCOL+F ; C1MGNS: DB 27,'&a18L' C1CURS: DB 27,'&a18c5R',255;col 1 top ; C2MGNS: DB 27,'&a73L' C2CURS: DB 27,'&a73c5R',255;col 2 top ; FDCURS: DB 27,'&a60c1R' ;filename FN: DB ' ' DB 27,'&a54c78R';date DT: DB ' ' DB 27,'&a68c78R';pg# @ btm DB 'Page # ' PGNO: DS 2 DB 255 ; RAMADR: DS 2 ; FINISH: MVI A,12 ;form feed CALL TOPRT MVI A,27 CALL TOPRT MVI A,'E' ;reset LJ printer CALL TOPRT CALL BEEP RET ;end of this program ; MOVIT: LXI B,MOVIT-PROGRM ;length LXI H,PROGRM ;source LXI D,PROGRM+F ;dest CALL BLKMOV ;T200 block move RET END: END