I have a code in which I have:
EAX=00002c36
and after:
SBB eax, 0
the eax turns:
EAX=00002c35
Is that possible?
Shouldn’t eax be the same value?
If it’s correct, it seems like I don’t really understand the sbb instruction.
Thanks in adv
1
Per https://www.felixcloutier.com/x86/sbb , the x86 SBB instruction is equivalent to:
DEST := (DEST – (SRC + CF));
where DEST is the left operand, SRC is the right operand, and CF is the carry flag.
Your result is to be expected if the carry flag is 1. Per https://medium.com/@ismielabir/understanding-the-flag-register-in-x86-assembly-language-dc858ef1c38c :
“Carry Flag (CF): If there is a carry out from the most significant bit (MSB) on addition, or there is a borrow into the MSB on subtraction, CF will be 1. Otherwise, CF will be 0.”
You haven’t given any context, so we can’t tell what instruction set the carry flag. But there is nothing unexpected here.