Changeset 440 in xtideuniversalbios for trunk/Assembly_Library/Src/Util


Ignore:
Timestamp:
Aug 19, 2012, 10:56:59 AM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to Assembly Library:

  • Added function to sum bytes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/Util/Memory.asm

    r376 r440  
    142142    jmp     ax
    143143%endif
     144
     145
     146;--------------------------------------------------------------------
     147; Memory_SumCXbytesFromESSItoAL
     148;   Parameters
     149;       CX:     Number of bytes to sum (0=65536)
     150;       ES:SI:  Ptr to buffer containing the bytes to sum
     151;   Returns:
     152;       AL:     Sum of bytes
     153;   Corrupts registers:
     154;       CX
     155;--------------------------------------------------------------------
     156ALIGN JUMP_ALIGN
     157Memory_SumCXbytesFromESSItoAL:
     158    push    si
     159    xor     al, al
     160ALIGN JUMP_ALIGN
     161.AddNextByteToAL:
     162    add     al, [es:si]
     163    inc     si
     164    loop    .AddNextByteToAL
     165    pop     si
     166    ret
Note: See TracChangeset for help on using the changeset viewer.