home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / list / setmrg21.lbr / SRM20.Z80 < prev   
Text File  |  1987-11-08  |  1KB  |  71 lines

  1.  
  2. ;
  3. ;    PROGRAM:   SRM20.Z80
  4. ;    AUTHOR:    Fred Haines
  5. ;    PURPOSE:   This program sets the right margin on
  6. ;               printers using the Diablo 1610 command set
  7. ;    DATE:       August 30, 1986
  8.      
  9. ;    This program has only one command, SRM n, where n is a 
  10. ;    column number from 1-255, and it sets a right margin on
  11. ;    your Diablo 1610 compatible daisywheel printer in that 
  12. ;    column.  
  13.  
  14. ;
  15. ; general equates
  16.  
  17. bdos    equ    05h
  18. fcp    equ    5dh            ; fcb + 1
  19. esc    equ    1bh
  20. tab    equ    09h
  21.  
  22. ;
  23. ; external syslib routines
  24.  
  25.     ext    print
  26.     ext    crlf
  27.     ext    eval10
  28.     ext    lout
  29.  
  30. ;
  31. ; print program banner and help screen
  32.  
  33.     call    crlf
  34.     call     print
  35.     db    'SRM v2.0 - usage:',0
  36.     call    crlf
  37.     call    print
  38.     db    '   SRM n  set right margin at',0
  39.     call     crlf
  40.     call    print
  41.     db    '          column n [1-255]',0
  42.     call     crlf    
  43.  
  44. ;
  45. ; send prefix string to printer
  46.  
  47.     ld    a,esc
  48.     call    lout
  49.     ld    a,tab
  50.     call    lout
  51.  
  52. ;
  53. ; get offset, convert, send to printer
  54.  
  55.     ld    hl,fcp        ; point hl at column position
  56.     call    eval10        ; convert to hex, result in a and e
  57.     call    lout 
  58.  
  59. ;
  60. ; set right margin
  61.  
  62.     ld    a,esc
  63.     call    lout
  64.     ld    a,'0'
  65.     call    lout
  66.  
  67.     ret            ; finished
  68.  
  69. ;
  70.     end
  71. a and e