home *** CD-ROM | disk | FTP | other *** search
- /**************************************************/
- /* */
- /* VBIOS.C WRITTEN BY ERIC LEININGER */
- /* */
- /* C FUNCTIONS TO PROVIDE ACCESS TO BIOS AND BDOS */
- /* DISK SUBROUTINES */
- /* */
- /* ALL HAVE BEEN MODIFIED TO FIND BIOS FROM THE */
- /* WARM START VECTOR AT 00H */
- /**************************************************/
-
-
- reset()
- /**************************************************/
- /* */
- /* This routine calls BDOS to reset both disks */
- /* to read/write */
- /* */
- /**************************************************/
- {
- #asm
- MVI C,0DH ; RESET DISK SYSTEM
- CALL 005H ; GO TO IT
- #endasm
- return;
- }
-
- seldev(dev)
- int dev;
- /**************************************************/
- /* */
- /* This routine calls BIOS to select a disk */
- /* */
- /* When entered, HL contains 0 for disk A or */
- /* 1 for disk B */
- /* */
- /**************************************************/
- { dev;
- #asm
- BSEL EQU 0ED42H+1BH
- MOV C,L
- CALL1: CALL BSEL
- #endasm
- return;
- }
-
- home()
- /**************************************************/
- /* */
- /* This routine brings the selected device to */
- /* track 00 */
- /* */
- /**************************************************/
- {
- #asm
- BHOME EQU 0ED42H+018H ; BIOS + 18H
- CALL2: CALL BHOME ; CALL BIOS
- #endasm
- return;
- }
-
- setdma(bufin)
- int *bufin;
- /**************************************************/
- /* */
- /* This routine sets the disk DMA address pointer */
- /* to point to the buffer passed to the routine. */
- /* */
- /**************************************************/
- {
- bufin;
- #asm
- BDMA EQU 0ED42H+024H ; BIOS + 24H
- MOV B,H
- MOV C,L
- CALL3: CALL BDMA
- #endasm
- return;
- }
-
- settrk(track)
- int track;
- /**************************************************/
- /* */
- /* This routine sets track pointer. */
- /* Tracks are 0 to 39 */
- /* */
- /**************************************************/
- { track;
- #asm
- BTRACK EQU 0ED42H+01EH ; BIOS + 1EH
- MOV C,L
- CALL4: CALL BTRACK
- #endasm
- return;
- }
-
- setsec(sector)
- int sector;
- /**************************************************/
- /* */
- /* This routine sets sector pointer. */
- /* Sectors are 0 to 19 for single, 0 to 39 for */
- /* double density */
- /**************************************************/
- { sector;
- #asm
- BSECT EQU 0ED42H+21H ; BIOS + 21H
- MOV C,L
- CALL5: CALL BSECT
- #endasm
- return;
- }
-
- cpmread()
- /**************************************************/
- /* */
- /* This routine reads the disk. Before execution, */
- /* the drive must be selected and the DMA */
- /* address set. */
- /* */
- /**************************************************/
- {
- #asm
- BREAD EQU 0ED42H+027H ; BIOS + 27H
- CALL6: CALL BREAD
- #endasm
- return;
- }
-
- cpmput()
- /**************************************************/
- /* */
- /* This routine writes the disk. Before using, */
- /* the drive must be selected and the DMA */
- /* address set. */
- /* */
- /**************************************************/
- {
- #asm
- BWRITE EQU 0ED42H+02AH ; BIOS + 2AH
- CALL7: CALL BWRITE
- #endasm
- return;
- }
- /* end of file */