When disassembling, I often see that string manipulation instructions are used without regard to the state of the direction flag (DF), for example:
or ecx, 0FFFFFFFFh xor eax, eax mov edi, ebp repne scasb
No CLD or STD instructions were found because the function starts, nor other instructions that may affect the DF flag.
So, does the compiler accept the predefined state of this flag from the moment the program starts, kindly provided by the loader and remains unchanged during program execution?
source share