Changeset 503 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers


Ignore:
Timestamp:
Feb 13, 2013, 6:12:04 PM (11 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Optimized AH=0h a bit.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm

    r501 r503  
    3838;--------------------------------------------------------------------
    3939AH0h_HandlerForDiskControllerReset:
    40     xor     bx, bx                      ; Zero BH to assume no errors
    41     or      bl, dl                      ; Copy requested drive to BL
     40    ; Reset foreign Floppy and Hard Drives (those handled by other BIOSes)
     41    xor     bx, bx                                      ; Zero BH to assume no errors
     42    or      bl, dl                                      ; Copy requested drive to BL
     43    xor     ah, ah                                      ; Disk Controller Reset
     44    call    Int13h_CallPreviousInt13hHandler            ; Reset floppy drives only or floppy drives and foreign hard disks
     45    call    BackupErrorCodeFromTheRequestedDriveToBH
    4246
    4347%ifdef MODULE_SERIAL_FLOPPY
     
    6064    call    BackupErrorCodeFromTheRequestedDriveToBH    ; only one drive), but doing it again is not harmful.
    6165%endif
    62 
    63     ; Reset foreign Floppy and Hard Drives (those handled by other BIOSes)
    64     call    ResetForeignDrives
    6566    test    bl, bl                                      ; If we were called with a floppy disk, then we are done,
    6667    jns     SHORT .SkipHardDiskReset                    ; don't do hard disks.
     
    7778    mov     ah, bh
    7879    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    79 
    80 
    81 ;--------------------------------------------------------------------
    82 ; ResetForeignDrives
    83 ;   Parameters:
    84 ;       BL:     Requested Floppy or Hard Drive (DL when entering AH=00h)
    85 ;       DS:     RAMVARS segment
    86 ;   Returns:
    87 ;       BH:     Error code from requested drive (if available)
    88 ;   Corrupts registers:
    89 ;       AX, DL
    90 ;--------------------------------------------------------------------
    91 ResetForeignDrives:
    92     ; If there are drives after our drives, those are already reset
    93     ; since our INT 13h was called by some other BIOS.
    94     ; We only need to reset drives from the previous INT 13h handler.
    95     ; There could be more in chain but let the previous one handle them.
    96     mov     dl, [RAMVARS.bFirstDrv]
    97     or      dl, 80h                 ; We may not have our drives at all so change 0 to 80h!
    98     MIN_U   dl, bl
    99 
    100     xor     ah, ah                  ; Disk Controller Reset
    101     call    Int13h_CallPreviousInt13hHandler
    102 ;;; fall-through to BackupErrorCodeFromTheRequestedDriveToBH
    10380
    10481
Note: See TracChangeset for help on using the changeset viewer.