subtract with borrow can set ax to zero if there were no carry over
or to -1 if there was a carry over in one of the earlier operation
suppose 10 was subtracted from 9 in one of the earlier operation
sbb ax,ax will become -1
assemble this nippet in ollydbg arbitrarily some where and single step through it to understand what can be possible results
Code:
0040165C 33C0 XOR EAX,EAX
0040165E 40 INC EAX
0040165F 83E8 02 SUB EAX,2
00401662 1BC0 SBB EAX,EAX
00401664 83D8 FF SBB EAX,-1
00401667 33C0 XOR EAX,EAX
00401669 40 INC EAX
0040166A 83E8 01 SUB EAX,1
0040166D 1BC0 SBB EAX,EAX
0040166F 83D8 FF SBB EAX,-1
oh btw last but not least get the intel manuals from intel for free (postage prepaid by intel it comes to your door in max three days via fedex or amd manuals ( i believe amd too gives out those manulas for free posted to your door not sure)
and RTFM
