home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol089 / sbios.mac < prev    next >
Text File  |  1984-04-29  |  2KB  |  80 lines

  1. ;
  2. ; SYSLIB Module Name:  SBIOS
  3. ; Author:  Richard Conn
  4. ; SYSLIB Version Number:  2.0
  5. ; Module Version Number:  1.0
  6. ; Module Entry Points:
  7. ;    BIOS
  8. ; Module External References:
  9. ;    None
  10. ;
  11.  
  12. ;
  13. ;  SBIOS -- Direct BIOS I/O Routine
  14. ;    This routine provides the user with a direct interface into the
  15. ; CP/M BIOS.  It is called with the A Reg containing the index offset into
  16. ; the BIOS JMP table.  No registers are preserved by this routine.  The
  17. ; contents of HL, DE, and BC are passed to the BIOS unchanged.
  18. ;
  19. ;    The following table summarizes the BIOS JMP Table Entries --
  20. ;
  21. ;     Offset    Function
  22. ;     0    Cold Start
  23. ;     1    Warm Start
  24. ;     2    Console Status; Returns A=0FFH if char ready, A=0 if not
  25. ;     3    Console Input; Returns char in A
  26. ;     4    Console Output; Char passed in C
  27. ;     5    List Output; Char passed in C
  28. ;     6    Punch Output; Char passed in C
  29. ;     7    Reader Input; Returns char in A
  30. ;
  31. ;     8    Home Disk Head (Return Version Number); Returns Version Number
  32. ;            in HL
  33. ;     9    Select Disk; Disk Number (A=0, etc) passed in C
  34. ;    10    Set Track Number; Track Number passed in C
  35. ;    11    Set Sector Number; Sector Number passed in C
  36. ;    12    Set DMA Address; DMA address passed in BC
  37. ;    13    Read Disk; Returns A=0 if OK, A=1 if error
  38. ;    14    Write Disk; Returns A=0 if OK, A=1 if error
  39. ;
  40. ;    15    List Status; Returns A=0FFH if ready to output, A=0 if not
  41. ;    16    Sector Translation; Logical-to-Physical Sector Translation;
  42. ;            Logical Sector Number passed in BC and Translate
  43. ;            Table Address passed in DE; Returns Physical Sector
  44. ;            Number in HL
  45. ;
  46.  
  47. ;
  48. ;  EQUATES
  49. ;
  50. WBADR    EQU    1    ; WARM BOOT ADDRESS
  51.  
  52. BIOS::
  53.     JMP    BIOSX
  54. HLBUF:
  55.     DS    2    ; BUFFER IN WHICH TO SAVE HL
  56. BIOSX:
  57.     PUSH    D    ; SAVE DE
  58.     SHLD    HLBUF    ; SAVE HL
  59.     LHLD    WBADR    ; GET ADDRESS OF WARM BOOT
  60.     DCX    H    ; BACK UP TO POINT TO COLD BOOT
  61.     DCX    H
  62.     DCX    H
  63.     LXI    D,3    ; PT TO ENTRY
  64. BIOSL:
  65.     ORA    A    ; DONE?
  66.     JZ    BIOSD
  67.     DAD    D    ; PT TO NEXT
  68.     DCR    A    ; COUNT DOWN
  69.     JMP    BIOSL
  70. ;
  71. ;  HL NOW POINTS TO BIOS JMP TO BE PERFORMED
  72. ;
  73. BIOSD:
  74.     POP    D    ; GET DE
  75.     PUSH    H    ; PLACE ROUTINE ADDRESS ON STACK
  76.     LHLD    HLBUF    ; RESTORE HL
  77.     RET        ; "CALL" INTO BIOS (RET ADR IS CALLER OF BIOS)
  78.  
  79.     END
  80.