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 / ZSYS / SIMTEL20 / ZCPR3 / RECORD.MAC < prev    next >
Text File  |  2000-06-30  |  4KB  |  194 lines

  1. ;
  2. ;  PROGRAM:  RECORD
  3. ;  AUTHOR:  RICHARD CONN
  4. ;  VERSION:  3.0
  5. ;  DATE:  4 Apr 84
  6. ;  PREVIOUS VERSIONS:  1.3 (5 Jan 83), 1.4 (6 Jan 83)
  7. ;  PREVIOUS VERSIONS:  1.0 (30 Dec 82), 1.1 (31 Dec 82), 1.2 (1 Jan 83)
  8. ;
  9. VERS    EQU    30
  10. z3env    SET    0f400h
  11.  
  12. ;
  13. ;    RECORD enables and disables the disk output redirectable I/O
  14. ; drivers for ZCPR2.  This command takes two forms:
  15. ;
  16. ;        RECORD ON    <-- Turn on console recording
  17. ;        RECORD OFF    <-- Turn off console recording
  18. ;        RECORD ON P    <-- Turn on printer recording
  19. ;        RECORD OFF P    <-- Turn off printer recording
  20. ;
  21.     ext    z3init,getiop
  22.     ext    eprint
  23.  
  24. fcb    equ    5dh        ;FCB Input
  25. fcb2    equ    6dh        ;FCB2 Input
  26. cr    equ    0dh
  27. lf    equ    0ah
  28.  
  29. ;
  30. ; Environment Definition
  31. ;
  32.     if    z3env ne 0
  33. ;
  34. ; External ZCPR3 Environment Descriptor
  35. ;
  36.     jmp    start
  37.     db    'Z3ENV'    ;This is a ZCPR3 Utility
  38.     db    1    ;External Environment Descriptor
  39. z3eadr:
  40.     dw    z3env
  41. start:
  42.     lhld    z3eadr    ;pt to ZCPR3 environment
  43. ;
  44.     else
  45. ;
  46. ; Internal ZCPR3 Environment Descriptor
  47. ;
  48.     MACLIB    Z3BASE.LIB
  49.     MACLIB    SYSENV.LIB
  50. z3eadr:
  51.     jmp    start
  52.     SYSENV
  53. start:
  54.     lxi    h,z3eadr    ;pt to ZCPR3 environment
  55.     endif
  56.  
  57. ;
  58. ; Start of Program -- Initialize ZCPR3 Environment
  59. ;
  60.     call    z3init    ;initialize the ZCPR3 Env and the VLIB Env
  61.  
  62. ;
  63. ;  Start of Program
  64. ;
  65.     call    getiop        ;Check for I/O Driver Defn
  66.     mov    a,h
  67.     ora    l
  68.     jnz    start0
  69.     call    banner
  70.     call    eprint
  71.     db    cr,lf,'Abort -- I/O Driver Address NOT Defined',0
  72.     ret
  73. start0:
  74.     call    status        ;Call Status Routine
  75.     jz    nodriver    ;No Driver Available?
  76.     cpi    80H        ;MUST have Disk Driver Module (> 80H) Loaded
  77.     jnc    start1
  78.     call    banner
  79.     call    eprint
  80.     db    cr,lf,'Abort -- Disk Driver Module NOT Loaded',0
  81.     ret
  82. nodriver:
  83.     call    banner
  84.     call    eprint
  85.     db    cr,lf,'Abort -- No I/O Driver Module Loaded',0
  86.     ret
  87.  
  88. start1:
  89.     lda    fcb        ;Get first char
  90.     cpi    'O'        ;Must be O
  91.     jnz    help
  92.     lda    fcb+1        ;Get 2nd char
  93.     cpi    'N'        ;ON?
  94.     jnz    off
  95. on:
  96.     lda    fcb2    ;Printer?
  97.     cpi    'P'
  98.     jnz    on1
  99.     call    banner
  100.     call    eprint
  101.     db    '  ++ TTY Recording ON ++',0
  102.     call    lopen    ;LST
  103.     ret
  104. on1:
  105.     call    banner
  106.     call    eprint
  107.     db    '  ++ CRT Recording ON ++',0
  108.     call    copen    ;CRT
  109.     ret
  110. off:
  111.     lda    fcb2    ;Printer?
  112.     cpi    'P'
  113.     jnz    off1
  114.     call    lclose    ;Close Output
  115.     call    banner
  116.     call    eprint
  117.     db    '  ++ TTY Recording OFF ++',cr,lf,0
  118.     ret
  119. off1:
  120.     call    cclose    ;Close Output
  121.     call    banner
  122.     call    eprint
  123.     db    '  ++ CRT Recording OFF ++',cr,lf,0
  124.     ret
  125. ;
  126. ;  Print Help Message
  127. ;
  128. help:
  129.     call    banner
  130.     call    eprint
  131.     db    cr,lf
  132.     db    cr,lf,'RECORD turns on and off recording of screen displays'
  133.     db    cr,lf,'on disk under ZCPR3 with the SYSIO Redirectable I/O '
  134.     db    'Drivers'
  135.     db    cr,lf,'engaged.'
  136.     db    cr,lf
  137.     db    cr,lf,'It is invoked by two forms:'
  138.     db    cr,lf
  139.     db    cr,lf,'    RECORD ON  or RECORD ON PRINTER'
  140.     db    cr,lf,'    RECORD OFF or RECORD OFF PRINTER'
  141.     db    cr,lf
  142.     db    cr,lf,'Minimum Required Option Forms are ON, OF, and P:'
  143.     db    cr,lf,'    RECORD ON P = RECORD ON PRINTER'
  144.     db    cr,lf,'If the P option is given, then TTY output is '
  145.     db    'recorded,'
  146.     db    cr,lf,'else CRT output is recorded.'
  147.     db    cr,lf,0
  148.     ret
  149.  
  150. ;
  151. ;  I/O Driver Interface Routines
  152. ;
  153. status:
  154.     push    h        ;Save HL
  155.     push    d        ;Save DE
  156.     lxi    d,0        ;No Offset for Status
  157. runio:
  158.     call    getiop        ;Get I/O Base Address
  159.     dad    d        ;Pt to Routine
  160.     pop    d        ;Restore DE
  161.     xthl            ;Restore HL and Place Address on Stack
  162.     ret            ;"Run" Routine
  163. copen:
  164.     push    h        ;Save Regs
  165.     push    d
  166.     lxi    d,36        ;Offset for Console Open Routine
  167.     jmp    runio        ;Run Routine
  168. cclose:
  169.     push    h        ;Save Regs
  170.     push    d
  171.     lxi    d,39        ;Offset for Console Close Routine
  172.     jmp    runio
  173. lopen:
  174.     push    h        ;Save Regs
  175.     push    d
  176.     lxi    d,42        ;Offset for Printer Open Routine
  177.     jmp    runio
  178. lclose:
  179.     push    h        ;Save Regs
  180.     push    d
  181.     lxi    d,45        ;Offset for Printer Close Routine
  182.     jmp    runio
  183.  
  184. ;
  185. ; Print Banner
  186. ;
  187. banner:
  188.     call    eprint
  189.     db    'RECORD, Version '
  190.     db    (vers/10)+'0','.',(vers mod 10)+'0',0
  191.     ret
  192.  
  193.     end
  194.