home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / ENTERPRS / CPM / UTILS / A / BIOS-R62.LZH / CXPRINTE.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  2KB  |  79 lines

  1. ; This module has been considerably modified, and documented so that it
  2. ; can be easily adapted to the various device number and secondary address
  3. ; combinations that exist.  Use of theis module assumes that you interface
  4. ; will do any needed character conversion with your interface as it sends
  5. ; _ascii_, NOT petascii.  the buffer has been to all intents defeated, but
  6. ; still exists as 1 char in length as attempts to send data as a single
  7. ; char at a time (supposedly suported by FAST8502) did not work.  Also the
  8. ; redundant call to do$convt and print is left because the driver doesnt
  9. ; seem to work without it (let me know why if you figure it out).
  10. ; This module will not change any characters sent to the printer and will
  11. ; send all characters (not like the 6 DEC 85 system that seemed to always
  12. ; leave a form-feed lurking in the buffer for an unwary user)
  13. ;
  14. ; User assumes _All_ liability for the use of this module. Original
  15. ; copyright is maintained by Commodore where aplicable, all changes
  16. ; copyright april 26 1987 by James W. Waltrip IV
  17. ;
  18.  
  19.     title    'CXPRINTER    Commodore printer drivers    26 April 87'
  20.  
  21.     maclib    z80
  22.  
  23.     maclib    cxequ
  24.  
  25.     public    ?PT$I$1101,?PT$O$1,?pt$o$2
  26.  
  27.     extrn    ?fun65
  28.  
  29. ;
  30. ;    printer output in register C
  31. ;
  32.     dseg
  33. ?pt$o$2:
  34.     lxi     h,print
  35.     call    do$convt        ; C must be unchanged A=desired code
  36.     lxi    h,prt$buf$2
  37.     mov    a,c            ; char to print
  38.     mvi    b,5            ; device number of printer
  39.     mvi    c,5            ; secondary address
  40. ;
  41.     jr    prt$cont
  42.  
  43. do$convt:
  44.     pchl                ; HL,DE and B may be used
  45. ;
  46. ?pt$o$1:
  47.     lxi       h,print
  48.     call    do$convt
  49.     lxi    h,prt$buf$1
  50.     mov    a,c            ; char to print
  51.     mvi    b,4            ;device number of printer
  52.     mvi    c,5            ; secondary address
  53. ;                 ^------must be four for cardco LQ/3
  54. prt$cont:
  55.     mov    m,a
  56.     mvi    a,1
  57.     sta    vic$count    ; set number of bytes to send
  58.     shld    @buffer        ; save location to print from
  59.  
  60.     mov    a,b
  61.     sta    vic$drv        ; pass device # in Vic$drv
  62.     mov    a,c
  63.     sta    vic$trk        ; pass secondary adr in Vic$trk
  64.  
  65.     mvi    a,vic$prt
  66.     jmp    ?fun65
  67. ;
  68. print:
  69. ?pt$i$1101:
  70.     ret
  71.  
  72.     dseg
  73.  
  74.  
  75. prt$buf$lng    equ    1
  76.  
  77. prt$buf$1:    ds    prt$buf$lng
  78. prt$buf$2:    ds    prt$buf$lng
  79.