Hi,
does anyone here has code that allows to send characters to the printer, without relying on the ROM?
I'd like to add the possibility to write log datas on the printer (can be practical to track bugs, profile code, etc...) but I have no idea on how to do that without using LPRINT...
Thanks in advance
Printer port programming
Ok, Twilighte suggested copying the Rom routine, and it's actually short, so here it is for everybody's benefit:
To use it, just put the value in the accumulator and call the routine.
Code: Select all
; A=character to send
_PrinterSendChar
.(
php
sei
sta $301 ; Send A to port A of 6522
lda $300
and #$ef ; Set the strobe line low
sta $300
lda $300
ora #$10 ; Set the strobe line high
sta $300
plp
loop_wait ; Wait in a loop until active transition of CA1
lda $30d
and #2
beq loop_wait ; acknowledging the byte
lda $30d
rts
.)
-
- Flying Officer
- Posts: 148
- Joined: Fri Oct 12, 2007 8:08 pm