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 >
Assembly Source File  |  1992-12-08  |  3KB  |  91 lines

  1. ***************************************************
  2.  nam LPrinter
  3.  ttl level 2 parallel printer driver
  4. ***************************************************
  5. * This one works through the parallel port on the *
  6. * back of the J&M "CP" disk controller only.      *
  7. * With a change in the base address of CP.PORT    *
  8. * and CPSTAT, I see no reason it won't do for a   *
  9. * disto or ?? device. It works with most printers *
  10. * using a Tandy model 100 printer cable, however  *
  11. * pin 14 should be cut loose at the printer end   *
  12. * due to a logic short during the printers ACK    *
  13. * pulse. I didn't blow any chips, short is only   *
  14. * 10 u-secs per byte written to the port, I found *
  15. * it looking for something else! This EXPANDED    *
  16. * version of the routine furnished by J&M to drive*
  17. * parallel printers.It was being driven by their  *
  18. * bare bones routine which, if it is offline,     *
  19. * locks up the computer. I wrote this one to see  *
  20. * if there's a way out in the event of a printer  *
  21. * error and lockup, as in out of ribbon, paper etc*
  22. * THIS VERSION, #6, IS INTENDED TO WORK ON LEVEL  *
  23. * TWO. IT WILL SLEEP WHILE THE PRINTER IS BUSY,   *
  24. * THEREBY ALLOWING OTHER THINGS TO CONTINUE       *
  25. * INSTEAD OF LOCKING UP THE COMPUTER. ITS MATCHING*
  26. * DESCRIPTOR ALSO HAS THE "PORT EXTENDED ADDRESS" *
  27. * SET AT $07 AS REQUIRED FOR LEVEL TWO. SEE LP.dd *
  28. ***************************************************
  29. * printer port equates
  30. **********************
  31. CP.PORT equ $ff44 data port
  32. CP.STAT equ $ff4c status port
  33. CP.BUSY equ $01 not busy mask
  34. Mode set %00000111
  35. *********************************
  36. * os9defs are INSIDE IFP1, ENDC *
  37. *********************************
  38.  ifp1
  39.  use /h0/defs/os9defs
  40.  use /H0/defs/scfdefs
  41.  endc
  42. ******************
  43. * static storage *
  44. ******************
  45. CPMEM equ V.SCF+20
  46. *****************
  47. * module header *
  48. *****************
  49.  mod CPLEN,CPNAM,DRIVR+OBJCT,REENT+1
  50.  fdb CPENT execution offset
  51.  fdb CPMEM permanent storage size
  52.  fcb Mode
  53. CPENT
  54.  lbra INIT we can't do INIT!
  55.  lbra READ we can't do READ!
  56.  lbra WRITE that we can
  57.  lbra GETSTA NOPE!
  58.  lbra PUTSTA can't do this either!
  59.  lbra TERM not required either!
  60. ******************************
  61. * write to printer           *
  62. ******************************
  63. WRITE
  64.  pshs x save the pointer
  65. WRITE3
  66.  ldb >CP.STAT
  67.  bitb #CP.BUSY is it busy?
  68.  bne WRITE1 else go round again
  69. WRITE2
  70.  sta >CP.PORT ok to write it out
  71.  puls x restore pointer
  72. INIT
  73. READ
  74. GETSTA
  75. PUTSTA
  76. TERM
  77.  clrb no error
  78.  rts
  79. WRITE1
  80.  ldx #$1
  81.  os9 F$Sleep
  82.  bra WRITE3
  83. ******************************
  84. CPNAM
  85.  fcs "LPRINTER" now maybe I can keep
  86.  fcb $06 edition number, seriel & parallel in same boot!
  87.  emod
  88. CPLEN equ *
  89.  end
  90.  
  91.