Code: Select all
Procedure Test()
Protected quad1.q, *quad1 = @quad1
Quad1 = $FFFFFFF0 ;nearly overflowing lower 32bit
Debug "Before = 0x" + Hex(Quad1) + " / " + Str(Quad1) ; 0xFFFFFFF0 / 4294967280
! mov eax, [p.p_quad1] ;eax = lower 32bits of quad
! add dword [eax], 20 ;add to it, overflowing lower 32bit
! setc dl ;dl=carry flag, now set from overflow
! add [eax+4], dl ;increment the upper 32bits if dl was set
Debug "After = 0x" + Hex(Quad1) + " / " + Str(Quad1) ;0x100000004 / 4294967300
EndProcedure
Test()