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


Ignore:
Timestamp:
Jan 14, 2011, 10:57:46 PM (13 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Minor size optimizations in various files.

Location:
trunk/XTIDE_Universal_BIOS/Src/Handlers
Files:
10 edited

Legend:

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

    r43 r84  
    22; Project name  :   IDE BIOS
    33; Created date  :   21.9.2007
    4 ; Last update   :   24.8.2010
    5 ; Author        :   Tomi Tilli
     4; Last update   :   14.1.2011
     5; Author        :   Tomi Tilli,
     6;               :   Krister Nordvall (optimizations)
    67; Description   :   Int 13h BIOS functions (Floppy and Hard disk).
    78
     
    6364    ja      SHORT Int13h_UnsupportedFunction
    6465    mov     di, ax
     66%ifndef USE_186 ; This uses 9 bytes less and is about 5 cycles faster
     67    mov     al, ah                      ; Copy bits in AH to AL and then
     68    shl     al, 1                       ; shift them "back" 1 step
     69    and     al, 7Eh                     ; AND them (clears the MSB)
     70    cbw                                 ; Clear AH using sign extension
     71    xchg    di, ax                      ; and finally swap DI with AX
     72%else
    6573    eSHR_IM di, 7                       ; Shift function to DI...
    6674    and     di, BYTE 7Eh                ; ...and prepare for word lookup
     75%endif
    6776    jmp     [cs:di+g_rgw13hFuncJump]    ; Jump to BIOS function
    6877
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm

    r35 r84  
    22; Project name  :   IDE BIOS
    33; Created date  :   27.9.2007
    4 ; Last update   :   24.8.2010
    5 ; Author        :   Tomi Tilli
     4; Last update   :   13.1.2011
     5; Author        :   Tomi Tilli,
     6;               :   Krister Nordvall (optimizations)
    67; Description   :   Int 13h function AH=0h, Disk Controller Reset.
    78
     
    9899    mov     dl, bl
    99100    call    RamVars_IsDriveHandledByThisBIOS
    100     jc      SHORT .GetFirstDriveForForeignBios
    101     ret     ; Return what was in BL unmodified
     101    jnc     SHORT .Return               ; Return what was in BL unmodified
     102    mov     dl, 80h
    102103ALIGN JUMP_ALIGN
    103 .GetFirstDriveForForeignBios:
    104     mov     dl, 80h
     104.Return:
    105105    ret
    106106
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH11h_HRecal.asm

    r28 r84  
    22; Project name  :   IDE BIOS
    33; Created date  :   28.9.2007
    4 ; Last update   :   29.7.2010
    5 ; Author        :   Tomi Tilli
     4; Last update   :   14.1.2011
     5; Author        :   Tomi Tilli,
     6;               :   Krister Nordvall (optimizations)
    67; Description   :   Int 13h function AH=11h, Recalibrate.
    78
     
    3132    push    bx
    3233    push    ax
     34%ifndef USE_186
    3335    call    AH11h_RecalibrateDrive
    3436    jmp     Int13h_PopXRegsAndReturn
     37%else
     38    push    Int13h_PopXRegsAndReturn
     39    ; Fall through to AH11h_RecalibrateDrive
     40%endif
    3541
    3642
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH14h_HDiag.asm

    r35 r84  
    22; Project name  :   IDE BIOS
    33; Created date  :   28.9.2007
    4 ; Last update   :   24.8.2010
    5 ; Author        :   Tomi Tilli
     4; Last update   :   14.1.2011
     5; Author        :   Tomi Tilli,
     6;               :   Krister Nordvall (optimizations)
    67; Description   :   Int 13h function AH=14h, Controller Internal Diagnostic.
    78
     
    3132    mov     al, [di+DPT.bReset]         ; Load reset byte to AL
    3233    test    al, al                      ; Any error?
    33     jnz     SHORT .ReturnError
     34    mov     ah, RET_HD_RESETFAIL        ; Assume there was an error
     35    stc
     36    jnz     SHORT .Return
    3437    xor     ah, ah                      ; Zero AH and CF since success
     38.Return:
    3539    jmp     Int13h_PopDiDsAndReturn
    36 .ReturnError:
    37     mov     ah, RET_HD_RESETFAIL
    38     stc
    39     jmp     Int13h_PopDiDsAndReturn
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm

    r3 r84  
    22; Project name  :   IDE BIOS
    33; Created date  :   28.12.2009
    4 ; Last update   :   12.4.2010
    5 ; Author        :   Tomi Tilli
     4; Last update   :   14.1.2011
     5; Author        :   Tomi Tilli,
     6;               :   Krister Nordvall (optimizations)
    67; Description   :   Int 13h function AH=24h, Set Multiple Blocks.
    78
     
    3233    push    bx
    3334    push    ax
     35%ifndef USE_186
    3436    call    AH24h_SetBlockSize
    3537    jmp     Int13h_PopXRegsAndReturn
     38%else
     39    push    Int13h_PopXRegsAndReturn
     40    ; Fall through to AH24h_SetBlockSize
     41%endif
    3642
    3743
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm

    r3 r84  
    22; Project name  :   IDE BIOS
    33; Created date  :   13.10.2007
    4 ; Last update   :   13.4.2010
    5 ; Author        :   Tomi Tilli
     4; Last update   :   14.1.2011
     5; Author        :   Tomi Tilli,
     6;               :   Krister Nordvall (optimizations)
    67; Description   :   Int 13h function AH=4h, Verify Disk Sectors.
    78
     
    3940    push    bx
    4041    push    ax
     42%ifndef USE_186
    4143    call    AH4h_VerifySectors
    4244    jmp     Int13h_PopXRegsAndReturn
     45%else
     46    push    Int13h_PopXRegsAndReturn
     47    ; Fall through to AH4h_VerifySectors
     48%endif
    4349
    4450
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm

    r35 r84  
    22; Project name  :   IDE BIOS
    33; Created date  :   9.12.2007
    4 ; Last update   :   1.8.2010
    5 ; Author        :   Tomi Tilli
     4; Last update   :   14.1.2011
     5; Author        :   Tomi Tilli,
     6;               :   Krister Nordvall (optimizations)
    67; Description   :   Int 13h function AH=9h, Initialize Drive Parameters.
    78
     
    3132    push    bx
    3233    push    ax
     34%ifndef USE_186
    3335    call    AH9h_InitializeDriveForUse
    3436    jmp     Int13h_PopXRegsAndReturn
     37%else
     38    push    Int13h_PopXRegsAndReturn
     39    ; Fall through to AH9h_InitializeDriveForUse
     40%endif
    3541
    3642
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHCh_HSeek.asm

    r3 r84  
    22; Project name  :   IDE BIOS
    33; Created date  :   13.12.2007
    4 ; Last update   :   12.4.2010
    5 ; Author        :   Tomi Tilli
     4; Last update   :   14.1.2011
     5; Author        :   Tomi Tilli,
     6;               :   Krister Nordvall (optimizations)
    67; Description   :   Int 13h function AH=Ch, Seek.
    78
     
    3536    push    bx
    3637    push    ax
     38%ifndef USE_186
    3739    call    AHCh_SeekToCylinder
    3840    jmp     Int13h_PopXRegsAndReturn
     41%else
     42    push    Int13h_PopXRegsAndReturn
     43    ; Fall through to AHCh_SeekToCylinder
     44%endif
    3945
    4046
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm

    r35 r84  
    22; Project name  :   IDE BIOS
    33; Created date  :   9.12.2007
    4 ; Last update   :   24.8.2010
    5 ; Author        :   Tomi Tilli
     4; Last update   :   14.1.2011
     5; Author        :   Tomi Tilli,
     6;               :   Krister Nordvall (optimizations)
    67; Description   :   Int 13h function AH=Dh, Reset Hard Disk (Alternate reset).
    78
     
    2526ALIGN JUMP_ALIGN
    2627AHDh_HandlerForResetHardDisk:
     28%ifndef USE_186
    2729    call    AHDh_ResetDrive
    2830    jmp     Int13h_PopDiDsAndReturn
     31%else
     32    push    Int13h_PopDiDsAndReturn
     33    ; Fall through to AHDh_ResetDrive
     34%endif
    2935
    3036
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm

    r61 r84  
    22; Project name  :   IDE BIOS
    33; Created date  :   3.8.2007
    4 ; Last update   :   28.11.2010
    5 ; Author        :   Tomi Tilli
     4; Last update   :   14.1.2011
     5; Author        :   Tomi Tilli,
     6;               :   Krister Nordvall (optimizations)
    67; Description   :   Int 19h BIOS functions (Boot Strap Loader).
    78
     
    118119    dec     di                              ; Decrement retry counter
    119120    jnz     SHORT .ReadRetryLoop            ; Loop while retries left
    120     stc
    121121ALIGN JUMP_ALIGN
    122122.Return:
Note: See TracChangeset for help on using the changeset viewer.