home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / list / send.lbr / SEND.AQM / SEND.ASM
Assembly Source File  |  1987-05-23  |  1KB  |  69 lines

  1. ;
  2. ; SEND.ASM  Version 1.0
  3. ;    -- send a preconfigured string to the LST: device
  4. ;
  5. ; USAGE:
  6. ;
  7. ;    A>SEND
  8. ;
  9. ; Any parameters in the command tail will be ignored.
  10. ;
  11. ; Version 1.0 (May 15, 1987):
  12. ;        Gene Pizzetta
  13. ;        481 Revere Street
  14. ;        Revere, MA  02151
  15. ;        Compuserve
  16. ;        FOG #29
  17. ;        Voice (617) 284-0891
  18. ;
  19. ; Assemble with MAC.
  20. ;
  21. WBoot    equ    00h
  22. Bdos    equ    05h
  23. TPA    equ    100h
  24. LstOut    equ    05h
  25. PrtStr    equ    09h
  26. LF    equ    0Ah
  27. CR    equ    0Dh
  28. ;
  29.     org    TPA
  30.     jmp    MAIN
  31. SIGNON:    db    'SEND  v1.0 -- Gene Pizzetta',CR,LF,LF
  32.     db    'Sending string to LST:',CR,LF,'$'
  33. ;
  34. DONE:    db    'DONE',CR,LF,'$'
  35. ;
  36.     db    '---STRING-->'    ; marker for beginning of string
  37. STRING:    db    0FFh        ; string may be up to 64 bytes and
  38.     ds    120        ; must end with 0FFh
  39.     db    '<--END---'    ; marker for end of string
  40. ;
  41. MAIN:    push    psw
  42.     lxi    d,SIGNON
  43.     mvi    c,PrtStr    ; print sign on
  44.     call    Bdos
  45.     pop    psw
  46. ;
  47. LIST:    lxi    h,STRING    ; HL --> string
  48. LOOP:    mov    a,m        ; get byte <-- HL
  49.     cpi    0FFh        ; end of string?
  50.     jz    EXIT        ; (yes)
  51.     push    psw
  52.     push    h        ; save HL
  53.     mov    e,a        ; move byte to E
  54.     mvi    c,LstOut    ; ..and send it to printer
  55.     call    Bdos
  56.     pop    h        ; recover our string pointer
  57.     pop    psw
  58.     inx    h        ; ..increment it
  59.     jmp    LOOP        ; ..and get another byte
  60. ;
  61. EXIT:    push    psw
  62.     lxi    d,DONE
  63.     mvi    c,PrtStr    ; print "done"
  64.     call    Bdos
  65.     pop    psw
  66.     jmp    WBoot
  67. ;
  68.     end
  69.