Changeset 445 in xtideuniversalbios for trunk/Assembly_Library


Ignore:
Timestamp:
Aug 29, 2012, 12:59:23 PM (12 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/Assembly_Library
Files:
8 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
Note: See TracChangeset for help on using the changeset viewer.