; TITLE "SBIOS - Syslib 4.0" NAME ('BIOS') ;================================================================ ; Author : Harold F. Bower ; Derived from SBIOS.Z80 Ver 1.1 by Richard Conn ; Date : 11 Jun 89 ; Version : 1.3 ; Module : SBIOS ; Abstract: This module contains the routine BIOS which provides ; the user with a direct interface into the CP/M BIOS. It ; is called with a relative BIOS routine number which is ; converted into an address to which execution is trans- ; ferred. The Relative routine numbers are: ; ; Offset Function ; 0 Cold Start ; 1 Warm Start ; 2 Console Status; Returns A=0FFH if char ready, A=0 if not ; 3 Console Input; Returns char in A ; 4 Console Output; Char passed in C ; 5 List Output; Char passed in C ; 6 Punch Output; Char passed in C ; 7 Reader Input; Returns char in A ; 8 Home Disk Head (Return Version Number) ; Returns Version Number in HL ; 9 Select Disk; Disk Number (A=0, etc) passed in C ; 10 Set Track Number; Track Number passed in C ; 11 Set Sector Number; Sector Number passed in C ; 12 Set DMA Address; DMA address passed in BC ; 13 Read Disk; Returns A=0 if OK, A=1 if error ; 14 Write Disk; Returns A=0 if OK, A=1 if error ; 15 List Status; Returns A=0FFH if ready to output, A=0 if not ; 16 Sector Translation; Logical-to-Physical Sector Translation; ; Logical Sector Number passed in BC and Translate ; Table Address passed in DE; Returns Physical Sector ; Number in HL ; ; NOTE: This routine REQUIRES that the BIOS begin on a page ; (256-byte) boundary. ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC BIOS ; Definitions WBADR EQU 1 ; Warm boot vector address .Z80 CSEG ;=============================================================== ; NAME - BIOS ; Entry: A - Contains the relative address to execute ; Exit : - Respective BIOS routine values returned ; Uses : AF,BC,DE,HL ; Special Requirements: BIOS begins on Page (256-byte) boundary ;=============================================================== BIOS: PUSH HL ; Save Regs LD L,A ; Temp save of value ADD A,A ; Mult value * 2 ADD A,L ; * 3 LD HL,(WBADR) ; Get address of Warm Boot LD L,A EX (SP),HL ; Restore HL putting addr on stack RET ; "CALL" into BIOS (Ret Adr is caller of BIOS) END