home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / CDOSDSK4.ZIP / CDOSDSK4.TD0 / XIOS / FIDDS.A86 < prev    next >
Encoding:
Text File  |  1989-01-26  |  4.6 KB  |  206 lines

  1. ; FIDDS.A86
  2. title 'FIDDS routines'
  3. ;pagesize 60+11
  4. ;********************************************************
  5. ;*                            *
  6. ;*    CP/M FIELD INSTALLABLE DEVICE DRIVER HOOKS    *
  7. ;*    CDOS 6.0 XIOS                    *
  8. ;*    DRI OS ENGR, JMB, GMS, JW            *
  9. ;*                            *
  10. ;********************************************************
  11.  
  12.  
  13. ; Major mods:
  14. ; 6.0
  15. ;  6 APR 88 -- added extra space for Sun River terminal support
  16. ; 29 SEP 87 -- support multiple virtual on serial
  17. ;  9 SEP 87 -- return error from read_fid and write_fid
  18. ; 5.2
  19. ; 13 APR 87 -- support lots of consoles
  20. ; 25 MAR 86 -- add get int. vectors call
  21. ; 24 MAR 86 -- add TMP history buffer support
  22. ; 27 SEP 85 -- add sysdat_alloc call
  23. ; 11 JUN 85 -- update 4.1 ASM86 XIOS to RASM86
  24.  
  25. ; include COPYRITE.TXT
  26.  
  27. nolist
  28. include CDOS.EQU
  29. include XIOS.EQU
  30. list
  31. ; The following was include:
  32. ; include CDOS.EQU
  33. ; include XIOS.EQU
  34.  
  35. CGROUP    group    CODE
  36. DGROUP    group    fidds_dseg
  37.  
  38. public    sel_fid@,    read_fid@,    write_fid@
  39. public    i_dummy_fidds@,    i_fidds_flag@
  40. public    sysdat_alloc@
  41. public    sysdat_buff_base$, sysdat_buff_length$, sysdat_buff_link$
  42. public    check_init_reuse@
  43. public    prog_hist_base$, comm_hist_base$, ser_hist_base$
  44.  
  45.  
  46.  
  47. public    io_get_history_buff@, io_get_vectors@
  48.  
  49. extrn    XIOS_END:near, INIT_START:near
  50. extrn    ros_vectors$:byte
  51.     dseg
  52. extrn    ccb_list$ :word
  53. eject
  54.  
  55. ; CCPM-86 v1.0 FIDDS has been completely disabled because it gave us some
  56. ; problems when pc-mode BASIC hammered the interrupt vectors.
  57.  
  58.     cseg
  59.  
  60. sel_fid@:
  61. ;--------
  62.     sub    ax,ax            ; null return
  63.     ret
  64.  
  65. read_fid@:
  66. ;---------
  67.  
  68. write_fid@:
  69. ;----------
  70.     mov    ax,8001h        ; return "Not ready" error
  71.     ret
  72.  
  73.  
  74. ; Dummy FIDDS interrupt routine for non-disks:
  75.  
  76. i_dummy_fidds@:
  77. ;-------------
  78. ;    sub    ax,ax            ; zero for no select
  79. ;    iret
  80.  
  81.  
  82. ; Interrupt to return the lowest numbered unused system
  83. ; flag to FIDDS, to be used for a flagwait to eternity.
  84.  
  85. i_fidds_flag@:
  86. ;------------
  87.     sub    ax,ax
  88.     iret
  89.  
  90. ; Since FIDDS is not currently being supported, we'll just set the top
  91. ; flag to zero, and any existing CP/M FIDDS driver will think that there
  92. ; is no room for itself.
  93.  
  94. eject
  95.  
  96. sysdat_alloc@:
  97. ;------------
  98. ; Optional XIOS function to allocate buffer space in SYSDAT area to
  99. ; caller (device drivers, etc.):
  100. ; Entry: CX = bytes requested:
  101. ; Exit:  AX != 0 --> buffer offset
  102. ;     AX =  0 --> space not available, DX = max space left
  103. ;     CX = preserved
  104.  
  105.     mov    bp,cx
  106.     call    check_init_reuse@        ; first try init space
  107.      jnc    good_ret            ; leave if we got it
  108.  
  109.     mov    dx,sysdat_buff_length$        ; else look in reserved buff.
  110.     cmp    cx,dx
  111.      ja    zero_ret            ; if too big
  112.     sub    dx,cx                ; dx now = what's left
  113.     mov    sysdat_buff_length$,dx        ; replace
  114.     mov    ax,sysdat_buff_base$
  115.     add    sysdat_buff_base$,cx        ; and replace
  116. good_ret:
  117.     ret
  118. zero_ret:
  119.     sub    ax,ax
  120.     ret
  121.  
  122. check_init_reuse@:
  123. ;-----------------
  124. ; Allocate init space:
  125. ; Entry: bp = bytes wanted
  126. ; Exit: ax = offset, or C set if no room
  127.     mov    ax,init_start
  128.     mov    bx,ax
  129.     add    bx,bp                ; add amount requested
  130.      jc    no_room                ; 
  131.     cmp    bx,init_end
  132.      ja    no_room
  133.     mov    init_start,bx
  134.     clc ! ret
  135. no_room:
  136.     stc ! ret
  137.  
  138.  
  139. io_get_vectors@:
  140. ;===============
  141.     mov    ax,offset ros_vectors$
  142.     ret
  143.     
  144.  
  145. io_get_history_buff@:
  146. ;====================
  147. ; Return the segment address of the command-line recall structure/buffer(s) for
  148. ; the calling console:
  149. ; This function called only by the TMPs.
  150.  
  151. ; Entry:    DL == virtual console #
  152. ; Exit:        AX == segment of COMMAND history structure/buffer
  153. ;        DX == segment of PROGRAM history structure/buffer
  154. ;        AX and/or DX == 0 if command-line recall not supported
  155.  
  156. ; Initial history structure/buffer:
  157. ;----------------------------------
  158. ;    dw    0, BUFFER_LENGTH  |
  159. ;    db    0          |
  160. ;    rb    BUFFER_LENGTH      |
  161. ;----------------------------------
  162.  
  163.     mov    bl,dl
  164.     mov    dx,prog_hist_base$        ; all share same
  165.     cmp    bl,NUM_VIR_CONS
  166.      jae    ser_term
  167.  
  168. ; Here if a virtual con...all 4 share one buff:
  169.     mov    ax,comm_hist_base$
  170.     ret
  171.  
  172. ; Serial console - get its logical physical console number
  173. ; Virtual consoles share same buffer
  174. ser_term:
  175.     xor    bh,bh
  176.     shl    bx,1
  177.     mov    bx,ccb_list$[bx]    ; get ccb pointer for VS
  178.     mov    bl,C_PC[bx]        ; get physical console number
  179.     dec    bl            ; first serial is console 1    
  180.     xor    bh,bh
  181.     shl    bx,1
  182.     mov    ax,ser_hist_base[bx]
  183.     ret
  184.  
  185.  
  186.  
  187. fidds_dseg dseg
  188.  
  189. sysdat_buff_link$    dw    0000    ; space to link to next spare block
  190. sysdat_buff_base$    rw    1    ; done in INIT based on SETUP request
  191. sysdat_buff_length$    rw    1    ; ditto
  192.  
  193. init_start        dw    INIT_START
  194. init_end        dw    XIOS_END
  195.  
  196. prog_hist_base$        rw    1        ; allocated in INIT.
  197. comm_hist_base$        rw    1
  198.  
  199. ser_hist_base$        rw    24        ; support lots of consoles
  200.                         ; one buffer per physical
  201.     end
  202.  
  203.  
  204. ; END OF FIDDS.A86
  205.  
  206.