Changeset 181 in xtideuniversalbios for trunk/Configurator/Src/Libraries/math.asm


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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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:
Note: See TracChangeset for help on using the changeset viewer.