mov eax, 2
mov ebx, 4886718345
add eax, ebx
When doing this, the eax register returns with 591751051 instead of the correct result (4886718347). It seems it's only adding the lower 16 bits.
(Note: the numbers are in decimal)
32 bit add in ASM
Hi, I'm having some problems when adding 2 32-bit registers in ASM (using VC++ 6.0):
This is because 4886718345 is out of the range of a 32-bit unsigned int. If you modulo this with 2^32 you get 591751049 which when added to 2 gives you the result you are getting.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement