Changeset 77 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Libraries/math.asm


Ignore:
Timestamp:
Jan 4, 2011, 10:53:15 PM (13 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Minor size optimizations plus a bug fix in print.asm in Print_IntSW (DI was left hanging on the stack if the parameter in AX was positive). Also a very minor speed optimization in keys.asm in Keys_Backspace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Libraries/math.asm

    r3 r77  
    22; Project name  :   Math library
    33; Created date  :   7.10.2009
    4 ; Last update   :   1.1.2010
    5 ; Author        :   Tomi Tilli
     4; Last update   :   4.1.2011
     5; Author        :   Tomi Tilli,
     6;               :   Krister Nordvall (optimizations)
    67; Description   :   ASM library to for math related functions.     
    78
     
    122123.RetZero:                       ; Return 0 in DX:AX
    123124    xor     ax, ax
    124     xor     dx, dx
     125    cwd
    125126    ret
    126127%endif
     
    143144ALIGN JUMP_ALIGN
    144145Math_DivDWbyW:
    145     mov     bx, ax
    146     mov     ax, dx
    147     xor     dx, dx
     146    xor     bx, bx
     147    xchg    bx, ax
     148    xchg    dx, ax
    148149    div     cx
    149150    xchg    ax, bx
     
    171172    push    cx
    172173    push    ax
    173     mov     ax, cx              ; Copy divisor to AX
    174     mov     cl, 10              ; Load 10 to CL
     174    mov     al, 10              ; Load 10 to AL
     175    xchg    cx, ax              ; AX = Divisor CL = 10
    175176    div     cl                  ; AL = Divisor divided by 10
    176177    inc     ax                  ; Increment to compensate new remainder
Note: See TracChangeset for help on using the changeset viewer.