Code: Select all
Dim dwSum31 As ULong
Dim dwSum30 As ULong
Dim dwSum29 As ULong
Dim dwSum28 As ULong
Dim dwSum27 As ULong
Dim dwSum26 As ULong
Dim dwSum25 As ULong
Dim dwSum24 As ULong
Dim dwSum23 As ULong
Dim dwSum22 As ULong
Dim dwSum21 As ULong
Dim dwSum20 As ULong
Dim dwSum19 As ULong
Dim dwSum18 As ULong
Dim dwSum17 As ULong
Dim dwSum16 As ULong
Dim dwSum15 As ULong
Dim dwSum14 As ULong
Dim dwSum13 As ULong
Dim dwSum12 As ULong
Dim dwSum11 As ULong
Dim dwSum10 As ULong
Dim dwSum9 As ULong
Dim dwSum8 As ULong
Dim dwSum7 As ULong
Dim dwSum6 As ULong
Dim dwSum5 As ULong
Dim dwSum4 As ULong
Dim dwSum3 As ULong
Dim dwSum2 As ULong
Dim dwSum1 As ULong
Dim dwSum0 As ULong
ASM
mov ecx, [dwNumLongs]
mov esi, [dwInptr]
L31: lodsd ' load EAX with contents of address pointed to by ESI - ESI increments by 4
shl eax, 1 ' shift EAX left 1 bit
jnc L30
inc dword Ptr [dwSum31]
L30: shl eax, 1
jnc L29
inc dword Ptr [dwSum30]
L29: shl eax, 1
jnc L28
inc dword Ptr [dwSum29]
L28: shl eax, 1
jnc L27
inc dword Ptr [dwSum28]
L27: shl eax, 1
jnc L26
inc dword Ptr [dwSum27]
L26: shl eax, 1
jnc L25
inc dword Ptr [dwSum26]
L25: shl eax, 1
jnc L24
inc dword Ptr [dwSum25]
L24: shl eax, 1
jnc L23
inc dword Ptr [dwSum24]
L23: shl eax, 1
jnc L22
inc dword Ptr [dwSum23]
L22: shl eax, 1
jnc L21
inc dword Ptr [dwSum22]
L21: shl eax, 1
jnc L20
inc dword Ptr [dwSum21]
L20: shl eax, 1
jnc L19
inc dword Ptr [dwSum20]
L19: shl eax, 1
jnc L18
inc dword Ptr [dwSum19]
L18: shl eax, 1
jnc L17
inc dword Ptr [dwSum18]
L17: shl eax, 1
jnc L16
inc dword Ptr [dwSum17]
L16: shl eax, 1
jnc L15
inc dword Ptr [dwSum16]
L15: shl eax, 1
jnc L14
inc dword Ptr [dwSum15]
L14: shl eax, 1
jnc L13
inc dword Ptr [dwSum14]
L13: shl eax, 1
jnc L12
inc dword Ptr [dwSum13]
L12: shl eax, 1
jnc L11
inc dword Ptr [dwSum12]
L11: shl eax, 1
jnc L10
inc dword Ptr [dwSum11]
L10: shl eax, 1
jnc L09
inc dword Ptr [dwSum10]
L09: shl eax, 1
jnc L08
inc dword Ptr [dwSum9]
L08: shl eax, 1
jnc L07
inc dword Ptr [dwSum8]
L07: shl eax, 1
jnc L06
inc dword Ptr [dwSum7]
L06: shl eax, 1
jnc L05
inc dword Ptr [dwSum6]
L05: shl eax, 1
jnc L04
inc dword Ptr [dwSum5]
L04: shl eax, 1
jnc L03
inc dword Ptr [dwSum4]
L03: shl eax, 1
jnc L02
inc dword Ptr [dwSum3]
L02: shl eax, 1
jnc L01
inc dword Ptr [dwSum2]
L01: shl eax, 1
jnc L00
inc dword Ptr [dwSum1]
L00: shl eax, 1
jnc Loop
inc dword Ptr [dwSum0]
Loop: dec ecx ' decrement ECX
jg L31 ' jump to L31 if greater than 0
End ASM
uliSumOne32( 0 ) += dwSum0
uliSumOne32( 1 ) += dwSum1
uliSumOne32( 2 ) += dwSum2
uliSumOne32( 3 ) += dwSum3
uliSumOne32( 4 ) += dwSum4
uliSumOne32( 5 ) += dwSum5
uliSumOne32( 6 ) += dwSum6
uliSumOne32( 7 ) += dwSum7
uliSumOne32( 8 ) += dwSum8
uliSumOne32( 9 ) += dwSum9
uliSumOne32( 10 ) += dwSum10
uliSumOne32( 11 ) += dwSum11
uliSumOne32( 12 ) += dwSum12
uliSumOne32( 13 ) += dwSum13
uliSumOne32( 14 ) += dwSum14
uliSumOne32( 15 ) += dwSum15
uliSumOne32( 16 ) += dwSum16
uliSumOne32( 17 ) += dwSum17
uliSumOne32( 18 ) += dwSum18
uliSumOne32( 19 ) += dwSum19
uliSumOne32( 20 ) += dwSum20
uliSumOne32( 21 ) += dwSum21
uliSumOne32( 22 ) += dwSum22
uliSumOne32( 23 ) += dwSum23
uliSumOne32( 24 ) += dwSum24
uliSumOne32( 25 ) += dwSum25
uliSumOne32( 26 ) += dwSum26
uliSumOne32( 27 ) += dwSum27
uliSumOne32( 28 ) += dwSum28
uliSumOne32( 29 ) += dwSum29
uliSumOne32( 30 ) += dwSum30
uliSumOne32( 31 ) += dwSum31