> EPATALL / Hybrid program to dump all graphics MODEs  on the EPSON printer (! G B Hill September 1983 (c) 2 START PROGRAM < 29,0;0; F S% &FF Ppass_number = S% Zpattern0=S%+1 d!pattern0=&0300 npattern4=S%+3 x!pattern4=&3F00 pattern1=S%+5 !pattern1=&3F260400 pattern2=S%+9 !pattern2=&49841000 !(pattern2+4)=&FF6FB966 S%=S%+17 : limits B graphics "Not a graphics MODE. Can't dump.":7:"HELLO" assemble 6 enable printer, and set linefeed (send ESC A 8) 2,1,27,1,65,1,8  clear paper  1,10,1,10,1,10  Y%=1023 0 -16 F send bit code (ESC L 192 3 - 960 dots per line or 640 for MODE0) "1,27,1,76,1,n1,1,n2 , X%=0 1279 step_size 6!Xlo=X%+Y%*&10000 @ ?pass=0 J pixel T ^ 1,10 h r( reset linefeed and disable printer |1,27,1,65,1,12,1,12,3  "HELLO"  limits (A%=&87:mode=((&FFF4)&FF0000)65536 / mode>5 mode=3 graphics= graphics= ( mode=0 n1=128:n2=2 n1=192:n2=3 Q mode=0 step_size=2:?pass_number=1:?&80=pattern0 256:?&81=pattern0 256 Q mode=4 step_size=4:?pass_number=3:?&80=pattern4 256:?&81=pattern4 256 Z mode=1 mode=5 step_size=4:?pass_number=3:?&80=pattern1 256:?&81=pattern1 256 Q mode=2 step_size=8:?pass_number=6:?&80=pattern2 256:?&81=pattern2 256  assemble osword=&FFF1 oswrch=&FFEE  Xlo=S%+0  Xhi=S%+1  Ylo=S%+2 & Yhi=S%+3 0value=S%+4 : byte=S%+5 D pass=S%+6 Ncount_4=S%+7 X S%=S%+8 b opt=0 2 2 l P%=S% v [OPT opt \SUBROUTINES \to calculate X,Y)  .point ldx #Xlo 256 ldy #Xlo 256  lda #9 jmp osword $\subroutine to print a character .printchar  lda #1 jsr oswrch  lda byte jmp oswrch \decrement Y by 4  .dec_Y4 sec  lda Ylo * sbc #4 4 sta Ylo >bcc dec_Yhi Hrts R .dec_Yhi \ dec Yhi frts p\increment Y by 16 z .inc_Y16 clc  lda Ylo  adc #16  sta Ylo bcs inc_Yhi rts  .inc_Yhi  inc Yhi rts 8\to rotate in two bits, Enter with X=pass, Y=colour.  .two_bits :lda (&80),Y \select appropriate byte of pattern +cpx #0 \if pass is 0 rotate (beq rotate_in \next two bits in .rotate_out /ror A \otherwise dump two bits $ ror A .(dex \has X reached 0? 8,bne rotate_out \if not dump two more B.rotate_in L8ror A \if so next two bits go into byte V rol byte ` ror A j rol byte trts ~\to calculate a whole byte  .one_byte  jsr point  ldy value  lda pass  and #3 tax jsr two_bits jsr dec_Y4 dec count_4 1bne one_byte \if byte incomplete go back %jmp printchar \print the byte \MAIN PROGRAM 5\to calculate and print the pattern for one pixel  .pixel  lda #4 $sta count_4 \reset counter (jsr one_byte 2jsr inc_Y16 < inc pass F lda pass Pcmp pass_number Z bne pixel drts n] x