home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OS9_6X09
/
SYSMODS
/
JandM_PArallel_DR.lzh
/
LPrinter.asm
< prev
next >
Wrap
Assembly Source File
|
1992-12-08
|
3KB
|
91 lines
***************************************************
nam LPrinter
ttl level 2 parallel printer driver
***************************************************
* This one works through the parallel port on the *
* back of the J&M "CP" disk controller only. *
* With a change in the base address of CP.PORT *
* and CPSTAT, I see no reason it won't do for a *
* disto or ?? device. It works with most printers *
* using a Tandy model 100 printer cable, however *
* pin 14 should be cut loose at the printer end *
* due to a logic short during the printers ACK *
* pulse. I didn't blow any chips, short is only *
* 10 u-secs per byte written to the port, I found *
* it looking for something else! This EXPANDED *
* version of the routine furnished by J&M to drive*
* parallel printers.It was being driven by their *
* bare bones routine which, if it is offline, *
* locks up the computer. I wrote this one to see *
* if there's a way out in the event of a printer *
* error and lockup, as in out of ribbon, paper etc*
* THIS VERSION, #6, IS INTENDED TO WORK ON LEVEL *
* TWO. IT WILL SLEEP WHILE THE PRINTER IS BUSY, *
* THEREBY ALLOWING OTHER THINGS TO CONTINUE *
* INSTEAD OF LOCKING UP THE COMPUTER. ITS MATCHING*
* DESCRIPTOR ALSO HAS THE "PORT EXTENDED ADDRESS" *
* SET AT $07 AS REQUIRED FOR LEVEL TWO. SEE LP.dd *
***************************************************
* printer port equates
**********************
CP.PORT equ $ff44 data port
CP.STAT equ $ff4c status port
CP.BUSY equ $01 not busy mask
Mode set %00000111
*********************************
* os9defs are INSIDE IFP1, ENDC *
*********************************
ifp1
use /h0/defs/os9defs
use /H0/defs/scfdefs
endc
******************
* static storage *
******************
CPMEM equ V.SCF+20
*****************
* module header *
*****************
mod CPLEN,CPNAM,DRIVR+OBJCT,REENT+1
fdb CPENT execution offset
fdb CPMEM permanent storage size
fcb Mode
CPENT
lbra INIT we can't do INIT!
lbra READ we can't do READ!
lbra WRITE that we can
lbra GETSTA NOPE!
lbra PUTSTA can't do this either!
lbra TERM not required either!
******************************
* write to printer *
******************************
WRITE
pshs x save the pointer
WRITE3
ldb >CP.STAT
bitb #CP.BUSY is it busy?
bne WRITE1 else go round again
WRITE2
sta >CP.PORT ok to write it out
puls x restore pointer
INIT
READ
GETSTA
PUTSTA
TERM
clrb no error
rts
WRITE1
ldx #$1
os9 F$Sleep
bra WRITE3
******************************
CPNAM
fcs "LPRINTER" now maybe I can keep
fcb $06 edition number, seriel & parallel in same boot!
emod
CPLEN equ *
end