assembly - ASM: add 0xFFFFFFFF -


Im currently disassembly is backtracking and stumbled upon a series of instructions that I can not understand: Looking at that esi .

  .text: 00C20263 CMP Dividend PTR [esi + 80h], 0. Text: 00C2026 AJNS short locale 2027D   

As you can see if the member is not + 0x80 0 (the member is an integer) code to 00C2027D :

  .text: 00C2027D add Dword ptr [esi + 80h], 0FFFFFFFFh .text: 00C20284 jnz short loc_c20291   

These are two instructions that I really can not understand. First, the member has grown by 0xFFFFFFFF; But when the member is not 0, then this instruction will not exceed the maximum value of 32 bit integer? And when does the jnz jump?

Can anyone explain what the purpose of these two instructions is?

For a signed variable, it is similar to 0FFFFFFFFh -1, so lowering it from one value and Checking that it has made zero. Compilers will often emit "add negative value" rather than sub-directions, possibly because this compiler allows reuse for both tapping and subtraction of logic.

Comments