Changeset 181 in xtideuniversalbios for trunk/Configurator


Ignore:
Timestamp:
Nov 13, 2011, 3:38:40 PM (12 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/Configurator/Src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Configurator/Src/BiosFile.asm

    r145 r181  
    2929
    3030    ; Ask if user wants to save
    31     mov     ax, cs
    32     mov     ds, ax
    33     mov     es, ax
     31    push    cs
     32    pop     ds
     33    push    cs
     34    pop     es
    3435    call    BiosFile_DoesUserWantToSaveChanges
    3536    jnc     SHORT .Return
  • trunk/Configurator/Src/Libraries/math.asm

    r78 r181  
    1 ; File name     :   math.asm
    21; Project name  :   Math library
    3 ; Created date  :   7.10.2009
    4 ; Last update   :   4.1.2011
    5 ; Author        :   Tomi Tilli,
    6 ;               :   Krister Nordvall (optimizations)
    7 ; Description   :   ASM library to for math related functions.     
     2; Description   :   ASM library for math related functions.
    83
    94;--------------- Equates -----------------------------
     
    2722;--------------------------------------------------------------------
    2823; Macro to select lesser of two unsigned operands.
    29 ; 
     24;
    3025; MIN_U
    3126;   Parameters:
     
    4843;--------------------------------------------------------------------
    4944; Macro to select greater of two unsigned operands.
    50 ; 
     45;
    5146; MAX_U
    5247;   Parameters:
     
    6964;--------------------------------------------------------------------
    7065; Macro to select lesser and greater of two unsigned operands.
    71 ; 
     66;
    7267; MINMAX_U
    7368;   Parameters:
     
    8277%macro MINMAX_U 2
    8378    cmp     %1, %2              ; Is %1 smaller?
    84     jbe     %%Return            ;  If so, return
     79    jb      %%Return            ;  If so, return
    8580    xchg    %1, %2              ; Exchange operands
    8681ALIGN JUMP_ALIGN
     
    9388; Multiplies unsigned 32-bit integer by unsigned 16-bit integer.
    9489; Result is unsigned 32-bit integer, so overflow is possible.
    95 ; 
     90;
    9691; Math_MulDWbyW
    9792;   Parameters:
     
    130125;--------------------------------------------------------------------
    131126; Divide a 32-bit unsigned integer so that quotient can be 32-bit.
    132 ; 
     127;
    133128; Math_DivDWbyW
    134129;   Parameters:
     
    157152;--------------------------------------------------------------------
    158153; Converts remainder to tenths.
    159 ; 
     154;
    160155; Math_RemToTenths
    161156;   Parameters:
  • trunk/Configurator/Src/Libraries/menu/menudraw.asm

    r170 r181  
    287287    test    BYTE [bp+MENUVARS.bFlags], FLG_MNU_HIDENFO  ; Information hidden?
    288288    jnz     SHORT .JumpToBottomBorder
    289     test    cx, cx                          ; Any info strings?
    290     jz      SHORT MenuDraw_BottomBorder
     289    jcxz    MenuDraw_BottomBorder           ; Any info strings?
    291290    push    cx
    292291    call    MenuDraw_MiddleBorder           ; Draw middle border
  • trunk/Configurator/Src/Libraries/menu/menumsg.asm

    r2 r181  
    1 ; File name     :   menumsg.asm
    21; Project name  :   Menu library
    3 ; Created date  :   13.11.2009
    4 ; Last update   :   10.1.2010
    5 ; Author        :   Tomi Tilli
    6 ; Description   :   ASM library to menu system.
     2; Description   :   ASM library for menu system.
    73;                   Contains functions for displaying messages.
    84
     
    156152ALIGN JUMP_ALIGN
    157153MenuMsg_GetTokenForLine:
    158     test    cx, cx              ; Line 0 wanted?
    159     jz      .GetFirst           ;  If so, just get token length
     154    jcxz    .GetFirst           ; Line 0 wanted? If so, just get token length
    160155    push    bp
    161156    push    si
     
    218213    jnc     .EndOfString                    ; Return if no tokens
    219214    eMOVZX  dx, BYTE [bp+MENUVARS.bWidth]   ; Menu width
    220     sub     dl, SIZE_MSG_HBRDR              ; To line length 
     215    sub     dl, SIZE_MSG_HBRDR              ; To line length
    221216    mov     bl, ' '                         ; Space character
    222217ALIGN JUMP_ALIGN
  • trunk/Configurator/Src/Libraries/print.asm

    r78 r181  
    1 ; File name     :   print.asm
    21; Project name  :   Print library
    3 ; Created date  :   6.10.2009
    4 ; Last update   :   4.1.2011
    5 ; Author        :   Tomi Tilli,
    6 ;               :   Krister Nordvall (optimizations)
    72; Description   :   ASM library for character and string
    83;                   printing related functions.
     
    9590;--------------------------------------------------------------------
    9691; Debugging macro that prints wanted character and newline.
    97 ; 
     92;
    9893; PRINT_DBG_CH
    9994;   Parameters:
     
    141136;
    142137;   NOTE! Caller must clean the stack variables!
    143 ; 
     138;
    144139; Print_Format
    145140;   Parameters:
     
    341336;--------------------------------------------------------------------
    342337; Prints newline character to change line.
    343 ; 
     338;
    344339; Print_Newline
    345340;   Parameters:
     
    363358    ret
    364359%endif
    365    
     360
    366361
    367362;--------------------------------------------------------------------
    368363; Prints wanted number of characters.
    369 ; 
     364;
    370365; Print_CharBuffer
    371366;   Parameters:
     
    404399;--------------------------------------------------------------------
    405400; Repeats wanted character.
    406 ; 
     401;
    407402; Print_Repeat
    408403;   Parameters:
     
    429424;--------------------------------------------------------------------
    430425; Prints boolean value.
    431 ; 
     426;
    432427; Print_Bool
    433428;   Parameters:
     
    455450;--------------------------------------------------------------------
    456451; Prints signed or unsigned 16-bit integer.
    457 ; 
     452;
    458453; Print_IntSW   Prints signed 16-bit word
    459454; Print_IntUW   Prints unsigned 16-bit word
     
    506501    PRINT_CHAR                  ; Print character
    507502    inc     di                  ; Increment chars printed
    508     test    cx, cx              ; Characters left
    509     jnz     .PrintLoop          ;  If so, loop
     503    inc     cx                  ; Characters left
     504    loop    .PrintLoop          ;  If so, loop
    510505    mov     dx, di              ; Copy chars printed to DX
    511506    pop     cx
     
    518513;--------------------------------------------------------------------
    519514; Prints unsigned 32-bit integer.
    520 ; 
     515;
    521516; Print_IntUDW
    522517;   Parameters:
     
    552547    PRINT_CHAR                  ; Print character
    553548    inc     di                  ; Increment chars printed
    554     test    cx, cx              ; Characters left
    555     jnz     .PrintLoop          ;  If so, loop
     549    inc     cx                  ; Characters left
     550    loop    .PrintLoop          ;  If so, loop
    556551    mov     dx, di              ; Copy characters printed to DX
    557552    pop     cx
     
    565560;--------------------------------------------------------------------
    566561; Prints 8-bit byte as hexadecimal string.
    567 ; 
     562;
    568563; Print_IntHexB
    569564;   Parameters:
     
    593588;--------------------------------------------------------------------
    594589; Prints 16-bit word as hexadecimal string.
    595 ; 
     590;
    596591; Print_IntHexW
    597592;   Parameters:
     
    621616;--------------------------------------------------------------------
    622617; Prints 32-bit dword as hexadecimal string.
    623 ; 
     618;
    624619; Print_IntHexDW
    625620;   Parameters:
     
    658653;--------------------------------------------------------------------
    659654; Prints hexadecimal character for every nybble for WORD.
    660 ; 
     655;
    661656; Print_HexString
    662657;   Parameters:
  • trunk/Configurator/Src/MenuPageItem.asm

    r145 r181  
    6565ALIGN JUMP_ALIGN
    6666MenuPageItem_DisplayHelpDialog:
     67    push    cs
     68    pop     es
    6769    mov     di, [di+MENUPAGEITEM.szHelp]    ; ES:DI now points to help string
    68     push    cs
    69     pop     es
    7070    mov     bl, WIDTH_DLG                   ; Dialog width
    7171    jmp     Menu_ShowMsgDlg
  • trunk/Configurator/Src/Menupages/FlashMenu.asm

    r145 r181  
    371371FlashMenu_CalculateCompletionPercentage:
    372372    cmp     WORD [si+FLASHVARS.wPagesLeft], 0
     373    mov     ax, 100
    373374    je      SHORT .FlashComplete
    374     mov     ax, 100
    375375    mul     WORD [si+FLASHVARS.wPagesLeft]
    376376    div     WORD [si+FLASHVARS.wTotalPages]     ; AX = Percentage left to write
     
    382382ALIGN JUMP_ALIGN
    383383.FlashComplete:
    384     mov     ax, 100
    385384    stc
    386385    ret
Note: See TracChangeset for help on using the changeset viewer.