Home > database >  MASM32 (Lib: Irvine32) Weird variable behavior
MASM32 (Lib: Irvine32) Weird variable behavior

Time:12-17

the problem is, that the if-statement is true multiple times, so the variable "iDATA" is 100 again, but at the same time, when I print the var after the if-statement, then it doesnt say that it's 100 and just goes up from 0-x, like you would expect it.

.data
iDATA DWORD 0

.code

main PROC
    loop0:
        mov eax, iDATA
        .if eax == 100
            call WriteInt
        .endif
        add iDATA, 1
    jmp loop0
main ENDP

INVOKE ExitProcess, 0
END main

output: 100 100 100 100 100 100 100 100...

pls explain me where my error is

CodePudding user response:

it re-looped, because of overflow

  • Related