home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol004 / filprint.asm < prev    next >
Encoding:
Assembly Source File  |  1984-04-29  |  1.1 KB  |  54 lines

  1. ;
  2. ;    FILPRINT.ASM as of 7/29/80
  3. ;     by Keith Petersen, W8SDZ
  4. ;
  5. ;    (for CP/M 2.x only)
  6. ;This program will print any ASCII file made with
  7. ;a CP/M editor.  The file must contain no tabs, and
  8. ;must end with a single $ character.  When you make
  9. ;the file with the editor, start it with one line
  10. ;of 80 spaces.  Then after you end the edit, DDT
  11. ;the file and patch it with FILPRINT.HEX (with no
  12. ;offset).  Save the patched file as a .COM file.
  13. ;
  14. ;
  15.     ORG    100H
  16. ;
  17. BEGIN:    LXI    H,STRING
  18. ;
  19. LOOP:    MOV    A,M    ;GET CHARACTER
  20.     CPI    '$'    ;ENDING CHAR?
  21.     RZ        ;RETURN TO CP/M
  22.     CALL    OUTPUT    ;OUTPUT CHAR & GET ANY INPUT
  23.     CPI    'C'-40H    ;CONTROL-C?
  24.     RZ        ;RETURN TO CP/M
  25.     INX    H    ;POINT TO NEXT CHAR
  26.     JMP    LOOP    ;GET ANOTHER CHAR
  27. ;
  28. OUTPUT:    MOV    E,A    ;CHAR TO E FOR CP/M
  29.     MVI    C,6    ;CP/M-2 DIRECT OUTPUT FUNCTION
  30.     CALL    DOFUNC    ;DO IT
  31.     MVI    E,0FFH
  32.     MVI    C,6    ;DIRECT INPUT WITH NO ECHO
  33.     CALL    DOFUNC    ;DO IT
  34.     ORA    A
  35.     RZ        ;NOTHING TYPED
  36.     CPI    'S'-40H    ;CONTROL-S?
  37.     RNZ
  38. WAIT:    MVI    E,0FFH
  39.     MVI    C,6
  40.     CALL    DOFUNC
  41.     ORA    A
  42.     JZ    WAIT
  43.     RET
  44. ;
  45. DOFUNC:    PUSH    H
  46.     CALL    5
  47.     POP    H
  48.     RET
  49. ;
  50. STRING:    DB    'CTL-S pauses, CTL-C aborts'
  51.     DB    0DH,0AH
  52. ;
  53.     END
  54.