home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / misc / insidcpm.lbr / BIOSCALL.LQB / BIOSCALL.LIB
Encoding:
Text File  |  1985-02-09  |  1.5 KB  |  40 lines

  1. ; * * * * *    BIOSCALL.LIB -- CODE FOR CALLING BIOS ENTRIES
  2. ;
  3. B$WBOOT    EQU    0*3    ; warm start
  4. B$CONST    EQU  1*3     ; console status
  5. B$CONIN    EQU  2*3     ; console input
  6. B$CONOUT   EQU  3*3     ; console output
  7. B$LIST     EQU  4*3     ; list output
  8. B$PUNCH    EQU  5*3     ; punch output
  9. B$READER   EQU  6*3     ; reader input
  10. B$HOME     EQU  7*3     ; seek to track 00
  11. B$SELDSK   EQU  8*3     ; select drive
  12. B$SETTRK   EQU  9*3     ; set track
  13. B$SETSEC   EQU  10*3    ; select record
  14. B$SETDMA   EQU  11*3    ; set buffer address
  15. B$READ     EQU  12*3    ; read one record
  16. B$WRITE    EQU  13*3    ; write one record
  17. B$LISTST   EQU  14*3    ; list device status
  18. B$SECTRAN  EQU  15*3    ; skew translation
  19. ;
  20. ;  Subroutine to call BIOS at the entry table
  21. ;  vector whose offset is in the [A] register
  22. ;  alters [AF], and [HL].  Preserves [BC], [DE]
  23. ;  ** NOTE: assumes BIOS is on page boundary **
  24. ;
  25. BIOSM    MACRO
  26. BIOS    EQU    $
  27.     PUSH  B !  PUSH  D
  28.         LHLD    BOOT+1        ; HL --> WBOOT entry
  29.         ADD    L               ; add [A] to make address
  30.         MOV    L,A             ; HL --> desired BIOS entry
  31.         PUSH    H               ; save that, get
  32.         LXI    H,BIOSRET       ; ..return address
  33.         XTHL                    ; stack return address,
  34.         PCHL                    ; ..go to BIOS, which
  35. BIOSRET    EQU    $               ; returns here
  36.         POP  D !  POP  B
  37.         RET
  38.         ENDM
  39. ; * * * * * END OF BIOSCALL.LIB
  40.