home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / programs / list / enspol10.lbr / RSXINIT.EQP / RSXINIT.ESP
Text File  |  1986-12-14  |  3KB  |  93 lines

  1. ; rename this RSXINIT.ESP to RSXINIT.INC for assembly with RSXMAST
  2. subttl    'ENSPOOL initialization, non-resident portion'
  3. ;
  4. ; Initialization for ENSPOOL printer spooler system
  5. ; This contains the minimum needed for an RSX system.  All the
  6. ; routines in the system are available.  Part of the RSX system
  7. ;    C.B. Falconer, 85/9/24
  8. ;
  9. ; Check run command parameters.  Carry if not satisfactory
  10. ; This routine may parse values into storage as desired. If failure
  11. ; and carry set, then (de) must return a pointer to a help msg.
  12. ;
  13. ; If ENSPOOL running, exit.  Otherwise create the specified file.
  14. ; a,f,b,c,d,e,h,l (allowed)
  15. chkparms:
  16.     lxi    d,0
  17.     mvi    a,@RSX
  18.     call    dos
  19.     ora    a
  20.     rnz;            active, killhk will deal
  21.     sta    buff;        mark output buffer empty
  22.     lda    tfcb1+1
  23.     cpi    ' '
  24.     stc
  25.     lxi    d,help
  26.     rz;            no file specified
  27.     mvi    e,0ffh
  28.     mvi    a,@USR
  29.     call    dos
  30.     sta    oldusr;        save entry user value
  31.     lxi    d,tfcb1
  32.     ldax    d
  33.     ora    a
  34.     jnz    ckp1;        a drive specified
  35.     mvi    a,@CUR
  36.     call    dos
  37.     inr    a
  38.     stax    d;        else make specific
  39. ckp1:    mvi    a,@DEL
  40.     call    dos;        delete any old
  41.     mvi    a,@MAK
  42.     call    dos;        create new file
  43.     lxi    d,makerr
  44.     inr    a
  45.     stc
  46.     rz;            file creation error
  47.     lxi    d,tfcb1
  48.     lxi    h,spfcb
  49.     mvi    b,36
  50. ckp2:    ldax    d;        move the opened FCB into
  51.     mov    m,a;        retained memory
  52.     inx    d
  53.     inx    h
  54.     dcr    b
  55.     jnz    ckp2
  56.     ora    a;        clear any carry, all well
  57.     ret
  58. ;
  59. makerr:    db    'Unable to create output file$'
  60. help:    db    'ENSPOOL [d:]filename[.typ]   '
  61.     db    '(spools list output to file)$'
  62. ;
  63. ; Custom initialization. 
  64. ; When this routine is reached the various bios vector copies
  65. ; (and patches if "driver" is true) have been made.  This 
  66. ; routine may alter the connectors in "biosv" to install new
  67. ; drivers, etc.  The original routines are available thru
  68. ; "bsave" table.  Remember that any routines connected MUST
  69. ; live in the retained portion of code, following "@keep"
  70. ; below, and I recommend putting their code in the "rsx" area.
  71. ; If "driver" is false any bios modifications made through
  72. ; this routine will only be available to applications calling
  73. ; the bios directly (through location 1), and not to BDOS.
  74. ; This example only outputs a message
  75. ; a,f,b,c,d,e,h,l allowed
  76. init:    ret
  77. ;
  78. ; This message is displayed on system signon.  Terminate with '$'
  79. signon:    db    'ENSPOOL v', ver / 10 +'0', '.', ver mod 10 + '0'
  80.     db    ' by C.B. Falconer',cr,lf,'$'
  81. ;
  82. ; This routine MUST be supplied.  Normally just returns.  It is
  83. ; called only when the RSX is found to be already installed.  If
  84. ; it returns the RSX will be brought down.  This may control the
  85. ; pre-installed RSX, and exit with "jmp boot".  When called the
  86. ; "ckparms" routine has already been executed, but "init" has
  87. ; not (and will not be called)
  88. ; a,f,b,c,d,e,h,l (allowed)
  89. killhk:    mvi    e,2
  90.     mvi    a,@RSX
  91.     call    dos;        do the final flushing
  92.     ret
  93.