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
/
SIMTEL
/
CPMUG
/
CPMUG008.ARK
/
BIOSGO.LIB
< prev
next >
Wrap
Text File
|
1984-04-29
|
2KB
|
73 lines
;++++++++++++++++++++++++++++++++++++++++++++++
;
; BIOS ADDRESS TRANSFER PROGRAM
;
; BIOSGO.LIB - Version 0.1 - 5 NOV 77
;
; Jeffrey W. Shook
; P.O. Box 185
; Rocky Point, NY 11778
; (516) 744 7133
;
;++++++++++++++++++++++++++++++++++++++++++++++
; This program allows access to the BIOS functions
; independent of the size of the CP/M system.
; This is accomplished in the following way:
;
; 1) The user program calls an entry in
; the BIOSGO entry table.
; 2) The call to BIOSGO in the table
; pushes the address of the next table
; entry on the stack and jumps to BIOSGO.
; 3) BIOSGO subtracts the address of the start
; of the table from the address of the
; entry point to obtain the offset from
; the start of the table.
; 4) This offset is then added to the starting
; address of the BIOS jump table in the CP/M
; system, and the result is pushed onto the
; stack.
; 5) A RET instruction is executed to
; pop the address into the program counter.
; Control is thus transferred to the proper
; BIOS routine and the return address of
; the original caller is still on the stack.
; BIOS FUNCTION CALLING TABLE
; Be sure not to remove any entries from
; this table or the wrong function will
; be called.
WBOOT: CALL BIOSGO
CONST: CALL BIOSGO
CONIN: CALL BIOSGO
CONOUT: CALL BIOSGO
LIST: CALL BIOSGO
PUNCH: CALL BIOSGO
READER: CALL BIOSGO
HOME: CALL BIOSGO
SELDSK: CALL BIOSGO
SETTRK: CALL BIOSGO
SETSEC: CALL BIOSGO
SETDMA: CALL BIOSGO
READS: CALL BIOSGO
WRITES: CALL BIOSGO
BIOSGO: XTHL ; Get call addr in HL, save HL on stack
PUSH D ; Save DE
XCHG ; Move call addr to DE
LHLD 1 ; Get BIOS entry address
DAD D ; Add call addr to entry addr
LXI D,-(WBOOT+3) ; Get start of table
DAD D ; Subtract table addr
POP D ; Restore DE
XTHL ; Restore HL, put jump addr on stack
RET ; Jump to BIOS routine