;PTC1JA.CO sends a .DO file to LaserJet ;printer in two columns. 12/19/2007 ;USES ALTLCD (F: = ALTLCD-PROGRM ;For T100 5/14/2004 (c)RHPigford. ;Becomes PTC1JA.CO when assembled ;with offset F: for ALTLCD opn. ;After ASSEMBLY, run the program where ;it sits in RAM (at 62000) by CALL62000 ;from BASIC. [This moves the address ;adjusted code to ALTLCD.] Then save ;SAVEM"PTC1JA",ALTLCD,MOVIT+F-1,0 ;where ALTLCD = 64704 and ; MOVIT+F-1 = 64982 ;Execute this using PTC1JA.BA. ;Upon entry, HL contains RAM addr ;of first byte of .DO text. ;Compr print, 1/8" line spacing ;Top Mgn = 3 lines ;PL = 70 lines ;Col Width = 40 in each ; Column 1 Column 2 ; LM=L1=18 LM=L2=73 ; RM=R1=58 RM=R2=103 ;First page = #1 ; ;Registers used to hold counters ; D=col cnt 0->3 E=Page cnt '1' + ; B=Chr cnt40->0 C=Line cnt 70->0 ; M100 T200 TOPRT: EQU 27967 ;33993 BEEP: EQU 16937 ;20293 BLKMOV: EQU 27611 ;33558 ALTLCD: EQU 64704 ;63572 PGMORG EQU 62000 ;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,0 ;set H=0, L=0 DAD SP ;put SP in HL SHLD START+1+F ;stuff SP below START: LXI SP,0 ;re-establish SP 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,70 ;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.5v0s2b0T' 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 ' z ' DB 27,'&a68c78R';pg# @ btm DB 'Page # ' PGNO: DS 2 DB 255 ; RAMADR: DS 2 ; FINISH: MVI A,12 ;form feed 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 ;M100 block move RET END: END