3

Why the zero flag must be different from zero? It is a little confusing, but the Zero Flag is set (i.e. its value is 1), if the last result IS zero: result is 0 ⇒ ZF is not 0 result is not 0 ⇒ ZF is 0 In general, a flag is set to show that the appropriate condition is true, or the appropriate event arised. (We also say that the flag is on (1) or off (0)). ...


2

Yes, this sounds perfectly normal. If the program did not use C++, you won't see thiscall with usage of ecx but just standard stdcall or cdecl which use only stack for passing arguments.


2

You seem to have the idea that ZF generally means that the operands were equal. This is wrong. It is not a property of the ZF that it shows whether the operands were equal. Instead, it is a property of CMP that it sets the zero flag if the operands are equal. This code snippet does not execute CMP. Instead, this code snippet executes TEST, which works ...


1

Let's go into the important instructions in the reversed order. JNZ ... Jump if Not Zero. You want to jump (over the "bad boy"), i.e. you want to obtain "Not Zero" in this (previous) instruction: TEST AL,AL To obtain "Not Zero", the value in AL have to be "Not Zero", too. The value of AL is set in this (previous) ...


Only top voted, non community-wiki answers of a minimum length are eligible