home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / soundpot / p / pcpip2.lbr / BIOSCALL.CZ / BIOSCALL.CV
Encoding:
Text File  |  1993-10-25  |  4.6 KB  |  147 lines

  1. /**************************************************/
  2. /*                                                */
  3. /* VBIOS.C        WRITTEN BY ERIC LEININGER    */
  4. /*                                                */
  5. /* C FUNCTIONS TO PROVIDE ACCESS TO BIOS AND BDOS */
  6. /*   DISK SUBROUTINES                             */
  7. /*                                                */
  8. /* ALL HAVE BEEN MODIFIED TO FIND BIOS FROM THE   */
  9. /*   WARM START VECTOR AT 00H                     */
  10. /**************************************************/
  11.  
  12.  
  13. reset()
  14. /**************************************************/                    
  15. /*                                                */
  16. /* This routine calls BDOS to reset both disks    */
  17. /*  to read/write                                 */
  18. /*                                                */
  19. /**************************************************/                    
  20. {
  21. #asm
  22.     MVI    C,0DH    ; RESET DISK SYSTEM    
  23.     CALL    005H    ; GO TO IT
  24. #endasm
  25.     return;
  26. }
  27.  
  28. seldev(dev)
  29. int dev;
  30. /**************************************************/                    
  31. /*                                                */
  32. /* This routine calls BIOS to select a disk       */
  33. /*                                                */
  34. /* When entered, HL contains 0 for disk A or      */
  35. /*   1 for disk B                                 */
  36. /*                                                */
  37. /**************************************************/                    
  38. {    dev;
  39. #asm
  40. BSEL    EQU    0ED42H+1BH    
  41.     MOV    C,L
  42. CALL1:    CALL    BSEL
  43. #endasm
  44.     return;
  45. }
  46.  
  47. home()
  48. /**************************************************/                    
  49. /*                                                */
  50. /* This routine brings the selected device to     */
  51. /*  track 00                                      */
  52. /*                                                */
  53. /**************************************************/                    
  54. {
  55. #asm
  56. BHOME    EQU    0ED42H+018H    ; BIOS + 18H
  57. CALL2:    CALL    BHOME        ; CALL BIOS
  58. #endasm
  59.     return;
  60. }
  61.  
  62. setdma(bufin)
  63. int *bufin;
  64. /**************************************************/                    
  65. /*                                                */
  66. /* This routine sets the disk DMA address pointer */
  67. /*  to point to the buffer passed to the routine. */
  68. /*                                                */
  69. /**************************************************/                    
  70. {
  71.     bufin;
  72. #asm
  73. BDMA    EQU    0ED42H+024H    ; BIOS + 24H
  74.     MOV    B,H
  75.     MOV    C,L
  76. CALL3:    CALL    BDMA
  77. #endasm
  78.     return;
  79. }
  80.  
  81. settrk(track)
  82. int track;
  83. /**************************************************/                    
  84. /*                                                */
  85. /* This routine sets track pointer.               */
  86. /* Tracks are 0 to 39                             */
  87. /*                                                */
  88. /**************************************************/                    
  89. {    track;
  90. #asm
  91. BTRACK    EQU    0ED42H+01EH    ; BIOS + 1EH 
  92.     MOV    C,L
  93. CALL4:    CALL    BTRACK
  94. #endasm
  95.     return;
  96. }
  97.  
  98. setsec(sector)
  99. int sector;
  100. /**************************************************/                    
  101. /*                                                */
  102. /* This routine sets sector pointer.              */
  103. /* Sectors are 0 to 19 for single, 0 to 39 for    */
  104. /*   double density                               */
  105. /**************************************************/                    
  106. {    sector;
  107. #asm
  108. BSECT    EQU    0ED42H+21H    ; BIOS + 21H
  109.     MOV    C,L
  110. CALL5:    CALL    BSECT
  111. #endasm
  112.     return;
  113. }
  114.  
  115. cpmread()
  116. /**************************************************/                    
  117. /*                                                */
  118. /* This routine reads the disk. Before execution, */
  119. /*  the drive must be selected and the DMA        */
  120. /*  address set.                                  */
  121. /*                                                */ 
  122. /**************************************************/                    
  123. {
  124. #asm
  125. BREAD    EQU    0ED42H+027H    ; BIOS + 27H
  126. CALL6:    CALL    BREAD
  127. #endasm
  128.     return;
  129. }
  130.  
  131. cpmput()
  132. /**************************************************/                    
  133. /*                                                */
  134. /* This routine writes the disk. Before using,    */
  135. /*  the drive must be selected and the DMA        */ 
  136. /*  address set.                                  */
  137. /*                                                */
  138. /**************************************************/                    
  139. {
  140. #asm
  141. BWRITE    EQU    0ED42H+02AH    ; BIOS + 2AH
  142. CALL7:    CALL    BWRITE
  143. #endasm
  144.     return;
  145. }
  146. /*  end of file */
  147.