Changeset 445 in xtideuniversalbios


Ignore:
Timestamp:
Aug 29, 2012, 12:59:23 PM (9 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • A speed optimization to the eSHL_IM macro for 386 and higher. This change breaks emulation in the sense that the macro will fail when given a memory operand as the first parameter.
  • Memory_SumCXbytesFromESSItoAL now returns with the zero flag set/cleared according to the result.
  • Unrolled all the 8 bit READ transfer loops to do 16 bytes per iteration. Added a new macro (UNROLL_SECTORS_IN_CX_TO_OWORDS) as part of it. Size wise this is expensive but I think it should be worth the ROM space. The WRITE transfer loops were left as is since writes are rare anyway (<10% of all disk I/O IIRC).
  • Minor optimizations and fixes here and there.
Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/Emulate.inc

    r420 r445  
    465465    eSHIFT_IM   %1, %2, shr
    466466%endmacro
     467
    467468%macro eSHL_IM 2
     469%ifdef USE_386
     470    %if %2 = 1
     471        add     %1, %1  ; Same size but faster on 386 and 486. Fails if %1 is a memory operand.
     472    %else
     473        eSHIFT_IM   %1, %2, shl
     474    %endif
     475%else
    468476    eSHIFT_IM   %1, %2, shl
    469 %endmacro
     477%endif
     478%endmacro
     479
    470480%macro eROR_IM 2
    471481    eSHIFT_IM   %1, %2, ror
    472482%endmacro
     483
    473484%macro eROL_IM 2
    474485    eSHIFT_IM   %1, %2, rol
    475486%endmacro
     487
    476488%macro eRCR_IM 2
    477489    eSHIFT_IM   %1, %2, rcr
    478490%endmacro
     491
    479492%macro eRCL_IM 2
    480493    eSHIFT_IM   %1, %2, rcl
  • trunk/Assembly_Library/Inc/Math.inc

    r287 r445  
    7979ALIGN JUMP_ALIGN
    8080.ShiftNextBit:
    81     shl     ax, 1
     81    eSHL_IM ax, 1
    8282    rcl     dx, 1
    8383    loop    .ShiftNextBit
  • trunk/Assembly_Library/Src/Display/DisplayCursor.asm

    r407 r445  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    18 ;       
     18;
    1919
    2020; Section containing code
     
    7272    xor     dh, dh
    7373    add     ax, dx                          ; Add column offset
    74     shl     ax, 1                           ; Convert to WORD offset
     74    eSHL_IM ax, 1                           ; Convert to WORD offset
    7575    add     ax, [VIDEO_BDA.wPageOffset]     ; AX = Video RAM offset
    7676    mov     [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], ax
  • trunk/Assembly_Library/Src/Display/DisplayFormat.asm

    r376 r445  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    18 ;       
     18;
    1919
    2020; Section containing code
     
    137137.ConvertIndexToFunctionOffset:
    138138    sub     bx, .rgcFormatCharToLookupIndex
    139     shl     bx, 1               ; Shift for WORD lookup
     139    eSHL_IM bx, 1               ; Shift for WORD lookup
    140140    mov     ax, [cs:bx+.rgfnFormatSpecifierParser]
    141141    ret
  • trunk/Assembly_Library/Src/Display/DisplayFormatCompressed.asm

    r376 r445  
    66
    77;
    8 ; XTIDE Universal BIOS and Associated Tools 
     8; XTIDE Universal BIOS and Associated Tools
    99; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    1010;
     
    1313; the Free Software Foundation; either version 2 of the License, or
    1414; (at your option) any later version.
    15 ; 
     15;
    1616; This program is distributed in the hope that it will be useful,
    1717; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1818; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    19 ; GNU General Public License for more details.     
     19; GNU General Public License for more details.
    2020; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    2121;
     
    194194
    195195.process_after_output:
    196     shl     ch,1                                ; check high order bits for end of string or space
     196    eSHL_IM ch,1                                ; check high order bits for end of string or space
    197197    jns     short DisplayFormatCompressed_ret
    198198    jnc     .decode
     
    208208; DisplayFormatCompressed_BaseFormatOffset and jump targets (must fit in 256 bytes)
    209209;
    210     shl     ch,1                ; setup ch for later testing of null in .process_after_output
     210    eSHL_IM ch,1                ; setup ch for later testing of null in .process_after_output
    211211    and     ax,0001fh           ; also clears AH for addition with BX and DX below
    212212
  • trunk/Assembly_Library/Src/Menu/CharOutLineSplitter.asm

    r376 r445  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    1818;
    19        
     19
    2020
    2121; Section containing code
     
    4040    ; Get last text line column offset to AX
    4141    call    MenuLocation_GetMaxTextLineLengthToAX
    42     shl     ax, 1           ; Characters to BYTEs
     42    eSHL_IM ax, 1           ; Characters to BYTEs
    4343    add     ax, dx
    4444
     
    6262    call    MenuLocation_GetTitleBordersTopLeftCoordinatesToAX
    6363    xor     ah, ah
    64     shl     ax, 1
     64    eSHL_IM ax, 1
    6565    ret
    6666
     
    8282
    8383    mov     dl, [VIDEO_BDA.wColumns]
    84     shl     dl, 1           ; DX = bytes per row
     84    eSHL_IM dl, 1           ; DX = bytes per row
    8585    mov     ax, di
    8686    div     dl              ; AL = row index, AH = column index
  • trunk/Assembly_Library/Src/Util/Memory.asm

    r440 r445  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    18 ;       
     18;
    1919
    2020; Section containing code
     
    151151;   Returns:
    152152;       AL:     Sum of bytes
     153;       ZF:     Set if result is zero
     154;               Cleared if result is non-zero
    153155;   Corrupts registers:
    154156;       CX
    155157;--------------------------------------------------------------------
     158%ifndef EXCLUDE_FROM_XTIDECFG
    156159ALIGN JUMP_ALIGN
    157160Memory_SumCXbytesFromESSItoAL:
    158161    push    si
     162    dec     si
    159163    xor     al, al
    160164ALIGN JUMP_ALIGN
    161165.AddNextByteToAL:
     166    inc     si
    162167    add     al, [es:si]
    163     inc     si
    164168    loop    .AddNextByteToAL
    165169    pop     si
    166170    ret
     171%endif
  • trunk/Assembly_Library/Src/Util/Sort.asm

    r376 r445  
    77
    88;
    9 ; XTIDE Universal BIOS and Associated Tools 
     9; XTIDE Universal BIOS and Associated Tools
    1010; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    1111;
     
    1414; the Free Software Foundation; either version 2 of the License, or
    1515; (at your option) any later version.
    16 ; 
     16;
    1717; This program is distributed in the hope that it will be useful,
    1818; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1919; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20 ; GNU General Public License for more details.     
     20; GNU General Public License for more details.
    2121; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    22 ;       
     22;
    2323
    2424; Algorith is from http://www.algolist.net/Algorithms/Sorting/Quicksort
     
    6262    push    di
    6363    mov     di, cx
    64     shl     cx, 1                       ; Reserve temp and pivot items
     64    eSHL_IM cx, 1                       ; Reserve temp and pivot items
    6565    add     cx, BYTE QSORT_PARAMS_size
    6666    eENTER_STRUCT cx
  • trunk/BIOS_Drive_Information_Tool/Src/AtaInfo.asm

    r426 r445  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    1818;
     
    175175;--------------------------------------------------------------------
    176176DisplayBlockModeInformationUsingAtaInfoFromDSBX:
    177     eMOVZX  ax, BYTE [bx+ATA1.bBlockSel]    ; ATA2+ has flag on high word
    178     eMOVZX  dx, BYTE [bx+ATA1.bBlckSize]
     177    eMOVZX  ax, [bx+ATA1.bBlockSel] ; ATA2+ has flag on high word
     178    cwd
     179    mov     dl, [bx+ATA1.bBlckSize]
    179180    mov     si, g_szBlockMode
    180181    jmp     Print_FormatStringFromSIwithParametersInAXDX
  • trunk/Configurator/Src/Libraries/math.asm

    r181 r445  
    104104    push    bx
    105105    mov     bx, dx              ; Copy hiword to BX
    106     xor     dx, dx              ; Zero DX for multiplication
    107106    mul     cx                  ; DX:AX = AX (loword) * CX (multiplier)
    108107    push    dx                  ; Push possible overflow
    109108    xchg    ax, bx              ; => AX=old hiword, BX=new loword
    110     xor     dx, dx              ; Zero DX for division
    111109    mul     cx                  ; DX:AX = AX (hiword) * CX (multiplier)
    112110    pop     dx                  ; Pop possible overflow from first mul
  • trunk/XTIDE_Universal_BIOS/Inc/IDE_8bit.inc

    r442 r445  
    44
    55;
    6 ; XTIDE Universal BIOS and Associated Tools 
     6; XTIDE Universal BIOS and Associated Tools
    77; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    88;
     
    1111; the Free Software Foundation; either version 2 of the License, or
    1212; (at your option) any later version.
    13 ; 
     13;
    1414; This program is distributed in the hope that it will be useful,
    1515; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1616; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17 ; GNU General Public License for more details.     
     17; GNU General Public License for more details.
    1818; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    1919;
     
    2525; UNROLL_SECTORS_IN_CX_TO_DWORDS
    2626; UNROLL_SECTORS_IN_CX_TO_QWORDS
     27; UNROLL_SECTORS_IN_CX_TO_OWORDS
    2728;   Parameters:
    2829;       CX:     Number of sectors in block
    2930;   Returns:
    30 ;       CX:     Number of DWORDs or QWORDs in block
     31;       CX:     Number of DWORDs, QWORDs or OWORDs in block
    3132;   Corrupts registers:
    3233;       Nothing
     
    4647%else
    4748    UNROLL_SECTORS_IN_CX_TO_DWORDS
     49    shr     cx, 1
     50%endif
     51%endmacro
     52
     53%macro UNROLL_SECTORS_IN_CX_TO_OWORDS 0
     54%ifdef USE_186
     55    shl     cx, 5
     56%else
     57    UNROLL_SECTORS_IN_CX_TO_QWORDS
    4858    shr     cx, 1
    4959%endif
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm

    r444 r445  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1616; GNU General Public License for more details.
    17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html               
    18 ;       
     17; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     18;
    1919
    2020; Section containing code
     
    7979    test    bh, FLG_DRVNHEAD_DRV            ; Wait already done for Master
    8080    jnz     SHORT .SkipLongWaitSinceDriveIsNotPrimaryMaster
    81     call    AHDh_WaitUnilDriveMotorHasReachedFullSpeed
     81    call    AHDh_WaitUntilDriveMotorHasReachedFullSpeed
    8282.SkipLongWaitSinceDriveIsNotPrimaryMaster:
    8383
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r444 r445  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    18 ;       
     18;
    1919
    2020; Structure containing variables for PIO transfer functions.
     
    119119    jc      SHORT ReturnWithTransferErrorInAH
    120120
    121     ; All sectors succesfully transferred
     121    ; All sectors successfully transferred
    122122    add     cx, [bp+PIOVARS.bSectorsDone]       ; Never sets CF
    123123    ret
     
    244244    ALIGN JUMP_ALIGN
    245245    ReadBlockFromXtideRev1:
    246         UNROLL_SECTORS_IN_CX_TO_QWORDS
     246        UNROLL_SECTORS_IN_CX_TO_OWORDS
    247247        mov     bl, 8       ; Bit mask for toggling data low/high reg
    248248    ALIGN JUMP_ALIGN
    249249    .InswLoop:
     250    %rep 8  ; WORDs
    250251        XTIDE_INSW
    251         XTIDE_INSW
    252         XTIDE_INSW
    253         XTIDE_INSW
     252    %endrep
    254253        loop    .InswLoop
    255254        ret
     
    259258        ALIGN JUMP_ALIGN
    260259        ReadBlockFromXtideRev2:
    261             UNROLL_SECTORS_IN_CX_TO_QWORDS
    262         ALIGN JUMP_ALIGN
    263         .ReadNextQword:
    264             in      ax, dx      ; Read 1st WORD
    265             stosw               ; Store 1st WORD to [ES:DI]
    266             in      ax, dx
    267             stosw               ; 2nd
    268             in      ax, dx
    269             stosw               ; 3rd
    270             in      ax, dx
    271             stosw               ; 4th
    272             loop    .ReadNextQword
     260            UNROLL_SECTORS_IN_CX_TO_OWORDS
     261        ALIGN JUMP_ALIGN
     262        .ReadNextOword:
     263        %rep 8  ; WORDs
     264            in      ax, dx      ; Read WORD
     265            stosw               ; Store WORD to [ES:DI]
     266        %endrep
     267            loop    .ReadNextOword
    273268            ret
    274269    %endif
     
    283278
    284279    %else ; If 8088/8086
    285             ALIGN JUMP_ALIGN
     280        ALIGN JUMP_ALIGN
    286281        ReadBlockFrom8bitDataPort:
    287             UNROLL_SECTORS_IN_CX_TO_DWORDS
    288         ALIGN JUMP_ALIGN
    289         .ReadNextDword:
    290             in      al, dx      ; Read 1st BYTE
    291             stosb               ; Store 1st BYTE to [ES:DI]
    292             in      al, dx
    293             stosb
    294 
    295             in      al, dx
    296             stosb
    297             in      al, dx
    298             stosb
    299             loop    .ReadNextDword
     282            UNROLL_SECTORS_IN_CX_TO_OWORDS
     283        ALIGN JUMP_ALIGN
     284        .ReadNextOword:
     285        %rep 16 ; BYTEs
     286            in      al, dx      ; Read BYTE
     287            stosb               ; Store BYTE to [ES:DI]
     288        %endrep
     289            loop    .ReadNextOword
    300290            ret
    301291    %endif
     
    349339    ALIGN JUMP_ALIGN
    350340    .OutswLoop:
     341    %rep 4  ; WORDs
    351342        XTIDE_OUTSW
    352         XTIDE_OUTSW
    353         XTIDE_OUTSW
    354         XTIDE_OUTSW
     343    %endrep
    355344        loop    .OutswLoop
    356345        pop     ds
     
    366355    ALIGN JUMP_ALIGN
    367356    .WriteNextQword:
     357    %rep 4  ; WORDs
    368358        XTIDE_MOD_OUTSW
    369         XTIDE_MOD_OUTSW
    370         XTIDE_MOD_OUTSW
    371         XTIDE_MOD_OUTSW
     359    %endrep
    372360        loop    .WriteNextQword
    373361        pop     ds
     
    392380        ALIGN JUMP_ALIGN
    393381        .WriteNextDword:
    394             lodsb               ; Load 1st BYTE from [DS:SI]
    395             out     dx, al      ; Write 1st BYTE
    396             lodsb
    397             out     dx, al
    398 
    399             lodsb
    400             out     dx, al
    401             lodsb
    402             out     dx, al
     382        %rep 4  ; BYTEs
     383            lodsb               ; Load BYTE from [DS:SI]
     384            out     dx, al      ; Write BYTE
     385        %endrep
    403386            loop    .WriteNextDword
    404387            pop     ds
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/JrIdeTransfer.asm

    r419 r445  
    121121    jc      SHORT ReturnWithMemoryIOtransferErrorInAH
    122122
    123     ; All rectors succesfully transferred
     123    ; All sectors successfully transferred
    124124    add     cx, [bp+PIOVARS.bSectorsDone]       ; Never sets CF
    125125    ret
  • trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialDPT.asm

    r376 r445  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    18 ;       
     18;
    1919
    2020; Section containing code
     
    3737
    3838;
    39 ; Note that this section is not under %ifdef MODULE_SERIAL_FLOPPY.  It is important to 
     39; Note that this section is not under %ifdef MODULE_SERIAL_FLOPPY.  It is important to
    4040; distinguish floppy disks presented by the server and not treat them as hard disks, even
    4141; if the floppy support is disabled.
    4242;
    4343        mov     al, [es:si+SerialServer_ATA_wDriveFlags]
    44         shl     al, 1
     44        eSHL_IM al, 1
    4545        mov     byte [di+DPT.bFlagsHigh], al
    46        
     46
    4747        ret
    4848
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm

    r443 r445  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    18 ;       
     18;
    1919
    2020; Section containing code
     
    103103    ; Jump to correct BIOS function
    104104    eMOVZX  bx, ah
    105     shl     bx, 1
     105    eSHL_IM bx, 1
    106106    cmp     ah, 25h                     ; Possible EBIOS function?
    107107%ifndef MODULE_EBIOS
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm

    r443 r445  
    244244;       Nothing
    245245;--------------------------------------------------------------------
     246DoNotEnable8bitMode:
    246247IgnoreInvalidCommandError:
    247248    xor     ah, ah  ; Clears CF
     
    270271;--------------------------------------------------------------------
    271272AH9h_Enable8bitPioModeForXTCF:
    272     eMOVZX  bx, BYTE [di+DPT.bIdevarsOffset]
     273    eMOVZX  bx, [di+DPT.bIdevarsOffset]
    273274    cmp     BYTE [cs:bx+IDEVARS.bDevice], DEVICE_8BIT_XTCF
    274     je      SHORT .Enable8bitMode
    275     xor     ah, ah      ; Do nothing for this device
    276     ret
    277 .Enable8bitMode:
     275    jne     SHORT DoNotEnable8bitMode
     276
    278277    mov     si, FEATURE_ENABLE_8BIT_PIO_TRANSFER_MODE
    279278    jmp     AH23h_SetControllerFeatures
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm

    r429 r445  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1616; GNU General Public License for more details.
    17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html               
    18 ;               
     17; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     18;
    1919
    2020; Section containing code
     
    106106    push    cx
    107107    push    ax
    108     call    AHDh_WaitUnilDriveMotorHasReachedFullSpeed
     108    call    AHDh_WaitUntilDriveMotorHasReachedFullSpeed
    109109    call    AH9h_InitializeDriveForUse          ; Initialize Master or Slave (Master will come first in DPT list)
    110110
     
    133133
    134134;--------------------------------------------------------------------
    135 ; AHDh_WaitUnilDriveMotorHasReachedFullSpeed
     135; AHDh_WaitUntilDriveMotorHasReachedFullSpeed
    136136;   Parameters:
    137137;       DS:DI:  Ptr to DPT
     
    142142;       AL, BX, CX, DX
    143143;--------------------------------------------------------------------
    144 AHDh_WaitUnilDriveMotorHasReachedFullSpeed:
     144AHDh_WaitUntilDriveMotorHasReachedFullSpeed:
    145145%ifdef MODULE_SERIAL
    146146    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm

    r421 r445  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1616; GNU General Public License for more details.
    17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html               
    18 ;               
     17; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     18;
    1919
    2020; Section containing code
     
    5555    call    Prepare_GetOldInt13hCommandIndexToBX
    5656    mov     al, [di+DPT.bFlagsLow]
    57     shl     al, 1                   ; Set CF if LBA48 supported
     57    eSHL_IM al, 1                   ; Set CF if LBA48 supported
    5858    adc     bl, bh                  ; LBA48 EXT commands
    5959    ret
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm

    r442 r445  
    44
    55;
    6 ; XTIDE Universal BIOS and Associated Tools 
     6; XTIDE Universal BIOS and Associated Tools
    77; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    88;
     
    1111; the Free Software Foundation; either version 2 of the License, or
    1212; (at your option) any later version.
    13 ; 
     13;
    1414; This program is distributed in the hope that it will be useful,
    1515; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1616; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17 ; GNU General Public License for more details.     
     17; GNU General Public License for more details.
    1818; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    19 ;       
     19;
    2020
    2121; Section containing code
     
    2828;   Returns:
    2929;       CF:     Set if failed to verify ATA-ID
    30 ;               Cleared if ATA-ID verified succesfully
     30;               Cleared if ATA-ID verified successfully
    3131;   Corrupts registers:
    3232;       AX, BX, CX
     
    4444    call    .CompareCHorSfromOffsetBXtoMaxValueInCX
    4545
    46     add     bx, BYTE ATA1.wHeadCnt - ATA1.wCylCnt
     46    mov     bl, ATA1.wHeadCnt & 0FFh
    4747    mov     cx, MAX_VALID_PCHS_HEADS
    4848    call    .CompareCHorSfromOffsetBXtoMaxValueInCX
    4949
    50     add     bx, BYTE ATA1.wSPT - ATA1.wHeadCnt
     50    mov     bl, ATA1.wSPT & 0FFh
    5151    mov     cl, MAX_VALID_PCHS_SECTORS_PER_TRACK
    5252    call    .CompareCHorSfromOffsetBXtoMaxValueInCX
     
    6969    ; Check checksum byte
    7070    mov     cx, ATA6_size
    71     call    Memory_SumCXbytesFromESSItoAL
    72     test    al, al
     71    call    Memory_SumCXbytesFromESSItoAL       ; Returns with ZF set according to result
    7372    jnz     SHORT .FailedToVerifyAtaID
    7473
     
    119118    mov     bx, [es:si+ATA1.bPioMode]
    120119    mov     ax, bx                  ; AH = 0, AL = PIO mode 0, 1 or 2
    121     shl     bx, 1                   ; Shift for WORD lookup
     120    eSHL_IM bx, 1                   ; Shift for WORD lookup
    122121    mov     cx, [cs:bx+.rgwPio0to2CycleTimeInNanosecs]
    123122
     
    187186;--------------------------------------------------------------------
    188187AtaID_GetActiveTimeToAXfromPioModeInBX:
    189     shl     bx, 1
    190     mov     ax, [cs:bx+.rgwPioModeToActiveTimeNs]
    191     shr     bx, 1
    192     ret
    193 
    194 .rgwPioModeToActiveTimeNs:
    195     dw      PIO_0_MIN_ACTIVE_TIME_NS
    196     dw      PIO_1_MIN_ACTIVE_TIME_NS
    197     dw      PIO_2_MIN_ACTIVE_TIME_NS
    198     dw      PIO_3_MIN_ACTIVE_TIME_NS
    199     dw      PIO_4_MIN_ACTIVE_TIME_NS
    200     dw      PIO_5_MIN_ACTIVE_TIME_NS
    201     dw      PIO_6_MIN_ACTIVE_TIME_NS
     188    eMOVZX  ax, [cs:bx+.rgbPioModeToActiveTimeNs]
     189    ret
     190
     191.rgbPioModeToActiveTimeNs:
     192    db      PIO_0_MIN_ACTIVE_TIME_NS
     193    db      PIO_1_MIN_ACTIVE_TIME_NS
     194    db      PIO_2_MIN_ACTIVE_TIME_NS
     195    db      PIO_3_MIN_ACTIVE_TIME_NS
     196    db      PIO_4_MIN_ACTIVE_TIME_NS
     197    db      PIO_5_MIN_ACTIVE_TIME_NS
     198    db      PIO_6_MIN_ACTIVE_TIME_NS
    202199
    203200%endif ; MODULE_ADVANCED_ATA
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm

    r423 r445  
    44;
    55;                   These algorithms are taken from: http://www.mossywell.com/boot-sequence
    6 ;                   Take a look at it for more detailed information.       
     6;                   Take a look at it for more detailed information.
    77;
    88;                   This file is shared with BIOS Drive Information Tool.
    99
    1010;
    11 ; XTIDE Universal BIOS and Associated Tools 
     11; XTIDE Universal BIOS and Associated Tools
    1212; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    1313;
     
    1616; the Free Software Foundation; either version 2 of the License, or
    1717; (at your option) any later version.
    18 ; 
     18;
    1919; This program is distributed in the hope that it will be useful,
    2020; but WITHOUT ANY WARRANTY; without even the implied warranty of
    2121; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    22 ; GNU General Public License for more details.     
     22; GNU General Public License for more details.
    2323; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    2424;
    25        
     25
    2626; Section containing code
    2727SECTION .text
     
    3333;       ES:SI:  Ptr to 512-byte ATA information read from the drive
    3434;   Returns:
    35 ;       BX:DX:AX:   48-bit sectohr count
     35;       BX:DX:AX:   48-bit sector count
    3636;       CL:         FLGL_DPT_LBA48 if LBA48 supported
    3737;                   Zero if only LBA28 is supported
     
    239239    jbe     SHORT ReturnLCHSinAXBLBH
    240240    shr     ax, 1       ; Halve cylinders
    241     shl     bl, 1       ; Double heads
     241    eSHL_IM bl, 1       ; Double heads
    242242    inc     cx          ; Increment bit shift count
    243243    mov     dl, TRANSLATEMODE_LARGE
     
    300300    cmp     ax, cx
    301301    jbe     SHORT .NumberOfHeadsNowInCX
    302     shl     cx, 1                       ; Double number of heads
    303     test    ch, ch                      ; Reached 256 heads?
    304     jz      SHORT .CompareNextValidNumberOfHeads
    305     dec     cx                          ;  If so, limit heads to 255
     302    eSHL_IM cl, 1                       ; Double number of heads
     303    jnz     SHORT .CompareNextValidNumberOfHeads    ; Reached 256 heads?
     304    dec     cl                          ;  If so, limit heads to 255
    306305.NumberOfHeadsNowInCX:
    307306    mov     bx, cx                      ; Number of heads are returned in BL
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm

    r422 r445  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    18 ;       
     18;
    1919
    2020; Section containing code
     
    145145
    146146    ; Compare user defined and ATA-ID sector count and select smaller
    147     xor     dx, dx
    148     xchg    bx, dx      ; User defined LBA now in BX:DX:AX
     147    mov     dx, bx
     148    xor     bx, bx      ; User defined LBA now in BX:DX:AX
    149149    cmp     bx, [di+DPT.twLbaSectors+4]
    150150    jb      SHORT .StoreUserDefinedSectorCountToDPT
  • trunk/XTIDE_Universal_BIOS/makefile

    r421 r445  
    1 ##################################################################################################
    2 # Makefile to build XTIDE Universal BIOS.                                                        #
    3 #                                                                                                #
    4 # Valid makefile targets are:                                                                    #
    5 # all       Removes existing files and builds binary files in \Build                             #
    6 # small     Builds 8 kiB binaries only (without checksum)                                        #
    7 # large     Builds 15 kiB binaries only (without checksum)                                       #
    8 # clean     Removes all files from \Build                                                        #
    9 # checksum* Builds all and then generates checksum byte to all binary files                      #
    10 # strings*  Compress src\Strings.asm to src\StringsCompressed.asm                                #
    11 #                                                                                                #
    12 # * at the end of target name means that Perl is required for the job.                           #
    13 # Build directory must be created manually if it does not exist.                                 #
    14 #                                                                                                #
    15 #                                                                                                #
    16 # Following modules can be included or excluded:                                                 #
    17 # MODULE_8BIT_IDE           Support for 8-BIT IDE cards like XTIDE                               #
    18 # MODULE_JRIDE              Support for JR-IDE/ISA                                               #
    19 # MODULE_ADVANCED_ATA       Native support for some VLB IDE controllers                          #
    20 # MODULE_BOOT_MENU          Boot Menu for selection of drive to boot from                        #
    21 # MODULE_EBIOS              Enhanced functions for accessing drives over 8.4 GB                  #
    22 # MODULE_HOTKEYS            Hotkey Bar to boot from any drive                                    #
    23 # MODULE_IRQ                IDE IRQ support                                                      #
    24 # MODULE_SERIAL             Virtual hard disks using serial port                                 #
    25 # MODULE_SERIAL_FLOPPY      Virtual floppy drives using serial port (requires MODULE_SERIAL)     #
    26 # MODULE_STRINGS_COMPRESSED Use compressed strings to save space                                 #
    27 # MODULE_FEATURE_SETS       Power Management support                                             #
    28 #                                                                                                #
    29 # Not modules but these affect the assembly:                                                     #
    30 # ELIMINATE_CGA_SNOW        Prevents CGA snowing at the cost of a few bytes                      #
    31 # RELOCATE_INT13H_STACK     Relocates INT 13h stack to top of stolen conventional memory         #
    32 # RESERVE_DIAGNOSTIC_CYLINDER Reserve one L-CHS cylinder for compatibility with old BIOSes       #
    33 # USE_186                   Use instructions supported by 80188/80186 and V20/V30 and later      #
    34 # USE_286                   Use instructions supported by 286 and later                          #
    35 # USE_386                   Use instructions supported by 386 and later                          #
    36 # USE_AT                    Use features supported on AT and later systems (not available on XT) #
    37 #                                                                                                #
    38 ##################################################################################################
     1####################################################################################################
     2# Makefile to build XTIDE Universal BIOS.                                                          #
     3#                                                                                                  #
     4# Valid makefile targets are:                                                                      #
     5# all       Removes existing files and builds binary files in \Build                               #
     6# small     Builds 8 kiB binaries only (without checksum)                                          #
     7# large     Builds 15 kiB binaries only (without checksum)                                         #
     8# clean     Removes all files from \Build                                                          #
     9# checksum* Builds all and then generates checksum byte to all binary files                        #
     10# strings*  Compress src\Strings.asm to src\StringsCompressed.asm                                  #
     11#                                                                                                  #
     12# * at the end of target name means that Perl is required for the job.                             #
     13# Build directory must be created manually if it does not exist.                                   #
     14#                                                                                                  #
     15#                                                                                                  #
     16# Following modules can be included or excluded:                                                   #
     17# MODULE_8BIT_IDE             Support for 8-BIT IDE cards like XTIDE                               #
     18# MODULE_JRIDE                Support for JR-IDE/ISA                                               #
     19# MODULE_ADVANCED_ATA         Native support for some VLB IDE controllers                          #
     20# MODULE_BOOT_MENU            Boot Menu for selection of drive to boot from                        #
     21# MODULE_EBIOS                Enhanced functions for accessing drives over 8.4 GB                  #
     22# MODULE_HOTKEYS              Hotkey Bar to boot from any drive                                    #
     23# MODULE_IRQ                  IDE IRQ support                                                      #
     24# MODULE_SERIAL               Virtual hard disks using serial port                                 #
     25# MODULE_SERIAL_FLOPPY        Virtual floppy drives using serial port (requires MODULE_SERIAL)     #
     26# MODULE_STRINGS_COMPRESSED   Use compressed strings to save space                                 #
     27# MODULE_FEATURE_SETS         Power Management support                                             #
     28#                                                                                                  #
     29# Not modules but these affect the assembly:                                                       #
     30# ELIMINATE_CGA_SNOW          Prevents CGA snowing at the cost of a few bytes                      #
     31# RELOCATE_INT13H_STACK       Relocates INT 13h stack to top of stolen conventional memory         #
     32# RESERVE_DIAGNOSTIC_CYLINDER Reserve one L-CHS cylinder for compatibility with old BIOSes         #
     33# USE_186                     Use instructions supported by 80188/80186 and V20/V30 and later      #
     34# USE_286                     Use instructions supported by 286 and later                          #
     35# USE_386                     Use instructions supported by 386 and later                          #
     36# USE_AT                      Use features supported on AT and later systems (not available on XT) #
     37#                                                                                                  #
     38####################################################################################################
    3939
    4040###########################################
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuitemPrint.asm

    r376 r445  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    18 ;       
     18;
    1919
    2020; Section containing code
     
    219219    cmp     ax,[si]
    220220    jz      .found
     221    inc     bx
     222    inc     bx
    221223    inc     si
    222224    inc     si
    223     inc     bx
    224     inc     bx
    225225    cmp     word [bx],0
    226226    jnz     .wordLoop
Note: See TracChangeset for help on using the changeset viewer.