home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / ZSYS / SIMTEL20 / SYSLIB / SLIB1.LBR / SBIOS.Z80 < prev    next >
Text File  |  2000-06-30  |  2KB  |  76 lines

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