PARPRINT - PARALLEL PRINTER SUPPORT FOR BASIC-V2.0 -------------------------------------------------- Accessing to a parallel, non-commodore printer via geocable and similar interfaces is a common need, especially from Basic. So, this little utility (parprint) together with this document may help. The program code is very simple and it fits into tape buffer area (828-944). And one can use it by two simple calls: Usage: . Sending a byte sys828,byte eg: a$="heyyyy":fori=1tolen(a$):sys828,asc(mid$(a$,i,1)):next sys828,13:sys828,10 note that if the printer is not online, this call blocks until it is or until the stop key is pressed. . Sending a string sys831,string eg: a$="heyyyy":sys831,a$ sys831,"hello world"+chr$(13)+chr$(10) this call also blocks if the printer is busy or absent. to pass the control to next command press stop key, pressing stop does not break your basic program at this point. Yes, it's that simple. If you don't have a user-port parallel-printer interface, you can build one easily. You only need a user-port connector, wires, and a DB-25 female connector. Following wiring schema enough to construct one: User-Port DB-25 / Printer gnd A ------------------ 18-25 gnd flag B ------------------ 11 busy pb0 C ------------------ 2 data0 pb1 D ------------------ 3 data1 pb2 E ------------------ 4 data2 pb3 F ------------------ 5 data3 pb4 H ------------------ 6 data4 pb5 J ------------------ 7 data5 pb6 K ------------------ 8 data6 pb7 L ------------------ 9 data7 pa2 M ------------------ 1 strobe Technical notes about the parprint: We use this code segment to send a byte through the parallel port, and acknowledge the receiver sta$dd01 lda$dd00 ora#$04 sta$dd00 and#$fb sta$dd00 But first the port must be prepared for output: lda#$ff sta$dd03 Also we need to check if the printer busy - lda#$10 bit$dd0d beq - ...continue if we combine them to construct parprint, we end up with this: $033c: jmp$0345 jmp$037b $0342: jmp$0351 $0345: lda#$ff sta$dd03 jsr$aefd ; read comma after 'sys828' jsr$b79e ; read a byte into X register txa $0351: pha txa pha - lda#$10 bit$dd0d bne + jsr$fbbc ; check stop key jsr$ffe1 ; read stop key bne - lda#$ff sta$91 ; don't give 'break error' + pla tax pla sta$dd01 lda$dd00 ora#$04 sta$dd00 and#$fb sta$dd00 rts $037b: lda#$ff sta$dd03 lda$19 pha lda$1a pha jsr$aefd ; read comma after 'sys831' jsr$ad9e ; a string value will be read jsr$b6a3 ; pointer to string is XY, with length A stx$19 sty$1a tax ldy#$00 - lda($19),y jsr$0342 iny dex bne - pla sta$1a pla sta$19 rts . That's all. 1998-Jan-21 Ilker Ficicilar filker@newton.physics.metu.edu.tr ---