home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol050 / bios1 < prev    next >
Encoding:
Text File  |  1984-04-29  |  5.6 KB  |  234 lines

  1.  
  2. ;CBIOS - Data Technology Corporation CP/M 2.2 CBIOS.
  3. ;
  4. ;    +-----------------------+
  5. ;    |            |
  6. ;    |    C B I O S     |
  7. ;    |            |
  8. ;    +-----------------------+
  9. ;
  10. ;
  11. ;
  12. ;    Version number:    2.2B
  13. ;    Version date:    October 27,1981
  14. ;
  15. ;
  16. ;            . Corrections to the I/O deblocking
  17. ;            routines.
  18. ;            . Restructuring of code.
  19. ;
  20. ;    Update date:    November 24, 1980
  21. ;
  22. ;            .  Changed disk selection code to allow
  23. ;            CP/M to reset a drive.
  24. ;
  25. ;    Update date:    November 30, 1980
  26. ;
  27. ;            .  Added conditional assembly for IEEE 796
  28. ;            and 696 host adapters.
  29. ;
  30. ;            December 4, 1980
  31. ;            .  Finished adapting for IEEE 796 host adapter.
  32. ;            January 6, 1981
  33. ;            .  Added MRX101D driver modifications
  34. ;
  35. ;    Update date:    March 16, 1981
  36. ;
  37. ;            .  Modified source files for ASM.
  38. ;
  39. ;    Update date:    March 27, 1981
  40. ;
  41. ;            .  Cold boot entry receives logical unit
  42. ;            number of host in A regiser.
  43. ;
  44. ;    Update date:    April 28, 1981
  45. ;            Modified for contoller timeout and maximum
  46. ;            hard disk configuration.
  47. ;
  48. ;    Update date:    May 25, 1981
  49. ;            Modified table expansion conditional assembly
  50. ;            statements to get around ASM problem.
  51. ;
  52. ;    Update date:    May 28, 1981
  53. ;            Modified table expansion for maximum of
  54. ;            sixteen (16) logical disks.
  55. ;    Update date:    June 4, 1981
  56. ;            Modified code for new CONFIG parameters.
  57. ;            Generate DPH, DSKMSK and DSKOFF tables
  58. ;            during cold boot to allow arbitrary drive
  59. ;            mix for four (4) logical units.  Logical
  60. ;            drives are assigned to CP/M disk names
  61. ;            (A,...,P) in the order of assending logical
  62. ;            unit number.
  63. ;
  64. ;
  65. ;    The following code is supplied to customers who
  66. ;    purchase a hard/floppy disk system from DTC.
  67. ;    The intent of the following code is to illustrate
  68. ;    how to create a CBIOS for the user supplied
  69. ;    CP/M 2.2.  The following CBIOS was developed and
  70. ;    tested using the following hardware components.
  71. ;
  72. ;    Data Technology Corporation's 696 host adapter.
  73. ;    CompuPro IEEE 696 chassis and motherboards.
  74. ;    CompuPro IEEE 696 Z-80 CPU board.
  75. ;    CompuPro IEEE 696 RAM XX boards (3).
  76. ;    CompuPro IEEE 696 Interfacer I (assigned port 0 thru 3).
  77. ;
  78. ;    O R
  79. ;
  80. ;    Data Technology Corporation's 796 host adapter.
  81. ;    Intel SBC 80/30 Single board computer.
  82. ;    Intel SBC 86/12 Memory board.
  83. VERS:    EQU    22
  84. CBIOSV:    EQU    4        ;CBIOS revision level
  85.  
  86.  
  87.  
  88. CR:    EQU    0Dh
  89. LF:    EQU    0Ah
  90.  
  91.  
  92.     IF    NOT (MSIZE / (64+2))    ;If absolute
  93. BIOS:    EQU    CBIOS        ;START OF CP/M JUMP TABLE
  94.     ENDIF
  95.     IF    MSIZE / (64+1)    ;If PRL generation
  96. BIOS:    EQU    (MSIZE*K+BIOSIZ) / K    ;Start of CP/M jump table
  97.     ENDIF
  98.  
  99. IOBYTE:    EQU    3        ;Location of IOBYTE
  100. CDISK:    EQU    4        ;Location of current disk
  101. DBUF:    EQU    80h
  102.  
  103.  
  104. ;    CP/M to host disk constants
  105.  
  106. CPMSIB:    EQU    1024/128    ;Standard sectors in block
  107. BLKSIZ:    EQU    2048        ;CP/M allocation size
  108. HSTSIB:    EQU    BLKSIZ/128    ;Sectors in host block
  109. HSTSIZ:    EQU    128*(MAXSEC+1)    ;host buffer size
  110. HSTSPT:    EQU    26        ;host disk sectors/TRK
  111. HSTBLK:    EQU    HSTSIZ/128    ;CP/M sects/host buff
  112. CPMSPT:    EQU    HSTBLK * HSTSPT    ;CP/M sectors/track
  113.  
  114.  
  115. D2DSM:    EQU    ((77-2)*2*CPMSPT/HSTSIB)-1
  116.  
  117.  
  118. ;    BDOS constants on entry to write
  119.  
  120. WRALL:    EQU    0        ;write to allocated
  121. WRDIR:    EQU    1        ;write to directory
  122. WRUAL:    EQU    2        ;write to unallocated
  123. ;    The following jump table defines the entry points
  124. ;    into the CBIOS for use by CP/M and other external
  125. ;    routines; therfore the order of these jump cannot
  126. ;    be modified.  The location of these jumps can only
  127. ;    be modified by 400h locations, which is a restriction
  128. ;    of MOVCPM.
  129.  
  130.     ORG    BIOS
  131.  
  132.     JMP    CBOOT        ;Cold boot
  133.     JMP    WBOOT        ;Warm boot
  134.     JMP    CONST        ;Console status (input)
  135.     JMP    CONIN        ;Console input
  136.     JMP    CONOUT        ;Console output
  137.     JMP    LIST        ;List output
  138.     JMP    PUNCH        ;Punch output
  139.     JMP    READER        ;Reader input
  140.     JMP    HOME        ;Set track to zero
  141.     JMP    SELDSK        ;Select disk unit
  142.     JMP    SETTRK        ;Set track
  143.     JMP    SETSEC        ;Set sector
  144.     JMP    SETDMA        ;Set Disk Memory Address
  145.     JMP    READ        ;Read from disk
  146.     JMP    WRITE        ;Write onto disk
  147.     JMP    LISTST        ;List status (output)
  148.     JMP    SECTRN        ;Translate sector number
  149. ;
  150. ;    THE FOLLOWING 8 ENTRIES ARE RESERVED FOR MP/M
  151. ;
  152.     JMP    SELMEMORY    ;SELECT MEMORY
  153.     JMP    POLLDEVICE    ;POLL DEVICE
  154.     JMP    STARTCLOCK    ;START CLOCK
  155.     JMP    STOPCLOCK    ;STOP CLOCK
  156.     JMP    EXITREGION    ;EXIT REGION
  157.     JMP    MAXCONSOLE    ;MAXIMUM CONSOLE NUMBER
  158.     JMP    SYSTEMINIT    ;SYSTEM INITIALIZATION
  159.     JMP    IDLE        ;IDLE
  160. ;
  161. ;    The following 2 entries are non-standard CP/M
  162. ;    and are optional.
  163. ;
  164.     JMP    SETNUM        ;Set number of sectors to read
  165.     JMP    SETXAD        ;Set extended address bank.
  166. ;
  167. ;
  168. ;    Drive Type table (indexed by CP/M unit #)
  169. ;    Format:    DB    DPB type
  170. ;        DB    Class 6, op code 0 type (or 0FFh)
  171. ;
  172. DTYPE:
  173.     DS    2*NDSK
  174. ;
  175. ;
  176. ;
  177. ;
  178. ;    Disk Parameter Header Blocks for disk drives
  179. ;    The format of these blocks are as follows:
  180. ;    16 bits = -> translation table.
  181. ;    48 bits = Work area for CP/M.
  182. ;    16 bits = -> DIRBUF.
  183. ;    16 bits = -> Parameter block.
  184. ;    16 bits = -> check vector.
  185. ;    16 bits = -> allocation vector.
  186.  
  187. DPH:            ;Disk parameter header
  188.     DS    16*NDSK
  189. ;
  190. ;
  191. ;
  192. ;
  193. ;    Sector Translation Tables.
  194.  
  195.  
  196. ;    Standard CP/M Distribution Format
  197. XLTS:    DB    0,6,12,18,24,4,10,16,22,2,8,14,20
  198.     DB    1,7,13,19,25,5,11,17,23,3,9,15,21
  199.  
  200. ;
  201. ;
  202. ;
  203. ;
  204. ;    Disk selection masks.
  205. ;        A   B   C   D   E   F   G   H
  206. DSKMSK:
  207.     DS    NDSK
  208.  
  209. ;        I   J   K   L   M   N   O   P
  210. ;
  211. ;
  212. ;
  213. ;
  214. ;    Disk offsets (indexed by type).
  215. DSKOFF:
  216.     DS    3*NDSK
  217.  
  218. ;    Disk type definition blocks for each particular mode.
  219. ;    The format of these areas are as follow:
  220. ;    8 bit = disk type code
  221. ;    16 bit = Sectors per track
  222. ;    8 bit  = Block shift
  223. ;    8 bit  = BS mask
  224. ;    8 bit  = Extent mask
  225. ;    16 bit = Disk allocation blocks - 1.
  226. ;    16 bit = Directory size.
  227. ;    16 bit = Allocation for directory.
  228. ;    16 bit = check area size.
  229. ;    16 bit = offset to first track.
  230.  
  231. DPB:
  232.     DS    16*DPBLN
  233.  
  234.