gdb with assembler: Print status of carry flag
You can use: info registers eflags to get the entire set of flags. You’ll see a line like: eflags 0x41 [ CF ZF ] which means that the eflags register is set to 0x41, with the carry and zero flags set.
You can use: info registers eflags to get the entire set of flags. You’ll see a line like: eflags 0x41 [ CF ZF ] which means that the eflags register is set to 0x41, with the carry and zero flags set.
Actually gcc will use the carry automatically if you write your code carefully… Current GCC can optimize hiWord += (loWord < loAdd); into add/adc (x86’s add-with-carry). This optimization was introduced in GCC5.3. With separate uint64_t chunks in 64-bit mode: https://godbolt.org/z/S2kGRz. And the same thing in 32-bit mode with uint32_t chunks: https://godbolt.org/z/9FC9vc (editor’s note: Of course … Read more