STC MOV AL, 5 SBB AL, 3 ; AL = 5 - 3 = 2, but I am getting 1 .. why? RET
It's quite simple really.
sbb is "subtract with borrow". It uses the CPU carry flag as the borrow flag.
stc sets the carry flag, which means that
sbb thinks there is a borrow and, instead of subtracting three from five, it subtracts four from five.
In this respect, the 8086 is the opposite of some other processors, notably the 6502 where
c=0 means there is a borrow, and
c=1 means there isn't a borrow.