>I've got the SAM parallel interface, but I've lost my instructions.
>Can anyone tell me how to read/write from it? Thanks...

Something along the lines of:

;entered with data to print in E

                LD BC,printerport+257 (usually 232, could be 234 though)
wnotbusy:       IN A,(C)
                RRA
                JR C,wnotbusy ;if bit 0 = set, then it's still busy, so loop

                OUT (C),B       ;make sure that strobe line is high..
                DEC B
                DEC C
                OUT (C),E       ;output data to output latch
                INC C
                OUT (C),B       ;make strobe line low
                INC B
                OUT (C),B       ;make strobe line high...

                RET

you can put an additional test at the START of your printer routine, before
you do anything else for:

LD BC,printerport+1
IN A,(C)
RRA
JR C,error      ;if set, printer is busy. But we're not printing anything! so
                ;the printer is most likely not online... tell the user that
                ;the printer is off line

;rest of routine...

Can someone check if I've got the busy bit polarity right? :)

Simon                
                
-!- Mains Hum: A sine of the times???

+- Email:[EMAIL PROTECTED] ---- Fidonet: 2:250/124.2 (Simon Cooke) -+
|  Snail:1 Dovey Close, Astley, Tyldesley, Manchester, M29 7NP, UK        |
|  Tel: (01942) 886084  Fax: (01942) 886084 (ring voice first to confirm!)|
+- WWW: http://jumper.mcc.ac.uk/~simonc ----------------------------------+

Reply via email to