Changeset 181 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device/IDE


Ignore:
Timestamp:
Nov 13, 2011, 3:38:40 PM (13 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes to all parts of the project:

  • Size optimizations.
  • Added a define (EXCLUDE_FROM_XTIDECFG) to exclude unused library code from XTIDECFG.
  • Tried to minimize time spent with interrupts disabled.
  • Some minor attempts to improve speed (reordering instructions etc).
  • Tried to improve readability, did some cleanup and fixed some errors in comments.
Location:
trunk/XTIDE_Universal_BIOS/Src/Device/IDE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm

    r160 r181  
    77;--------------------------------------------------------------------
    88; IdeIO_OutputALtoIdeRegisterInDL
     9; IdeIO_OutputALtoIdeControlBlockRegisterInDL
    910;   Parameters:
    1011;       AL:     Byte to output
    11 ;       DL:     IDE Register
     12;       DL:     IDE Register                (IdeIO_OutputALtoIdeRegisterInDL)
     13;               IDE Control Block Register  (IdeIO_OutputALtoIdeControlBlockRegisterInDL)
    1214;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    1315;   Returns:
     
    1820ALIGN JUMP_ALIGN
    1921IdeIO_OutputALtoIdeRegisterInDL:
    20     mov     bx, IDEVARS.wPort
    21     call    GetPortToDXandTranslateA0andA3ifNecessary
    22     out     dx, al
    23     ret
     22    mov     bl, IDEVARS.wPort
     23    SKIP2B  f   ; cmp ax, <next instruction>
     24    ; Fall to IdeIO_OutputALtoIdeControlBlockRegisterInDL
    2425
    25 
    26 ;--------------------------------------------------------------------
    27 ; IdeIO_OutputALtoIdeControlBlockRegisterInDL
    28 ;   Parameters:
    29 ;       AL:     Byte to output
    30 ;       DL:     IDE Control Block Register
    31 ;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    32 ;   Returns:
    33 ;       Nothing
    34 ;   Corrupts registers:
    35 ;       BX, DX
    36 ;--------------------------------------------------------------------
    37 ALIGN JUMP_ALIGN
    3826IdeIO_OutputALtoIdeControlBlockRegisterInDL:
    39     mov     bx, IDEVARS.wPortCtrl
     27    mov     bl, IDEVARS.wPortCtrl
    4028    call    GetPortToDXandTranslateA0andA3ifNecessary
    4129    out     dx, al
     
    5543ALIGN JUMP_ALIGN
    5644IdeIO_InputToALfromIdeRegisterInDL:
    57     mov     bx, IDEVARS.wPort
     45    mov     bl, IDEVARS.wPort
    5846    call    GetPortToDXandTranslateA0andA3ifNecessary
    5947    in      al, dx
     
    6452; GetPortToDXandTranslateA0andA3ifNecessary
    6553;   Parameters:
    66 ;       BX:     Offset to port in IDEVARS (IDEVARS.wPort or IDEVARS.wPortCtrl)
     54;       BL:     Offset to port in IDEVARS (IDEVARS.wPort or IDEVARS.wPortCtrl)
    6755;       DL:     IDE Register
    6856;       DS:DI:  Ptr to DPT (in RAMVARS segment)
     
    7462ALIGN JUMP_ALIGN
    7563GetPortToDXandTranslateA0andA3ifNecessary:
     64    xor     bh, bh
    7665    xor     dh, dh                          ; DX now has IDE register offset
    7766    add     bl, [di+DPT.bIdevarsOffset]     ; CS:BX now points port address
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r171 r181  
    230230ALIGN JUMP_ALIGN
    231231DualByteReadForXtide:
    232 %ifdef USE_186
    233     shr     cx, 2       ; Smaller but slower on 186/286
    234 %else
    235     times 2 shr cx, 1   ; Loop unrolling
    236 %endif
     232    eSHR_IM cx, 2       ; Loop unrolling
    237233    mov     bx, 8       ; Bit mask for toggling data low/high reg
    238234ALIGN JUMP_ALIGN
     
    322318    push    ds
    323319    push    bx
    324 %ifdef USE_186
    325     shr     cx, 2       ; Smaller but slower on 186/286
    326 %else
    327     times 2 shr cx, 1   ; Loop unrolling
    328 %endif
     320    eSHR_IM cx, 2       ; Loop unrolling
    329321    mov     bx, 8       ; Bit mask for toggling data low/high reg
    330322    push    es          ; Copy ES...
     
    372364WordWriteForXTIDEmod:
    373365    push    ds
    374 %ifdef USE_186
    375     shr     cx, 2       ; Smaller but slower on 186/286
    376 %else
    377     times 2 shr cx, 1   ; Loop unrolling
    378 %endif
     366    eSHR_IM cx, 2       ; Loop unrolling
    379367    push    es          ; Copy ES...
    380368    pop     ds          ; ...to DS
Note: See TracChangeset for help on using the changeset viewer.