Ignore:
Timestamp:
Mar 19, 2011, 8:09:41 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • INT 13h optimizations to save almost 100 bytes.
File:
1 edited

Legend:

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

    r128 r148  
    1010; AH0h_HandlerForDiskControllerReset
    1111;   Parameters:
    12 ;       AH:     Bios function 0h
    13 ;       DL:     Drive number (ignored so all drives are reset)
     12;       DL:     Translated Drive number (ignored so all drives are reset)
    1413;               If bit 7 is set all hard disks and floppy disks reset.
    15 ;   Parameters loaded by Int13h_Jump:
    16 ;       DS:     RAMVARS segment
    17 ;   Returns:
     14;       DS:DI:  Ptr to DPT (in RAMVARS segment)
     15;       SS:BP:  Ptr to INTPACK
     16;   Returns with INTPACK in SS:BP:
    1817;       AH:     Int 13h return status (from drive requested in DL)
    1918;       CF:     0 if succesfull, 1 if error
    20 ;       IF:     1
    21 ;   Corrupts registers:
    22 ;       Flags
    2319;--------------------------------------------------------------------
    2420ALIGN JUMP_ALIGN
    2521AH0h_HandlerForDiskControllerReset:
    26     push    dx
    27     push    cx
    28     push    bx
    29     push    ax
    30 
    3122    eMOVZX  bx, dl                      ; Copy requested drive to BL, zero BH to assume no errors
    3223    call    ResetFloppyDrivesWithInt40h
     
    3526    call    ResetForeignHardDisks
    3627    call    AH0h_ResetHardDisksHandledByOurBIOS
    37 ALIGN JUMP_ALIGN
    3828.SkipHardDiskReset:
    39     mov     ah, bh                      ; Copy error code to AH
    40     xor     al, al                      ; Zero AL...
    41     cmp     al, bh                      ; ...and set CF if error
    42     jmp     Int13h_PopXRegsAndReturn
     29    mov     ah, bh
     30    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    4331
    4432
     
    5745    and     dl, 7Fh                     ; Clear hard disk bit
    5846    xor     ah, ah                      ; Disk Controller Reset
    59     int     INTV_FLOPPY_FUNC
     47    int     BIOS_DISKETTE_INTERRUPT_40h
    6048    jmp     SHORT BackupErrorCodeFromTheRequestedDriveToBH
    6149
     
    9684    jnc     SHORT .Return               ; Return what was in BL unmodified
    9785    mov     dl, 80h
    98 ALIGN JUMP_ALIGN
    9986.Return:
    10087    ret
     
    171158BackupErrorCodeFromTheRequestedDriveToBH:
    172159    cmp     dl, bl              ; Requested drive?
    173     jne     SHORT .Return
    174     mov     bh, ah
    175 ALIGN JUMP_ALIGN
    176 .Return:
     160    eCMOVE  bh, ah
    177161    ret
Note: See TracChangeset for help on using the changeset viewer.