Carry Flag
I am reading "Assembly Language for Intel-Based Computers" by Kip R. Irvine. Section 4.2.6.2 is about the Carry Flag (CF). It says if we subtract an integer from a smaller integer, the CF will be set. This is true when I run, for example...
.data
val1 BYTE 1
val2 BYTE 2
.code
mov al, val1
sub al, val2 ; CF = 1 SF = 1
But when I do the arithmetic on paper...
Carry
0000 0001 1
1111 1110 -2
1111 1111 which is -1 in 2's complement form.
Where is the carry out? It says earlier in the book that the CF is set when the result of an unsigned arithmetic operation is too large to fit into the destination operand. But -1 fits into AL.
Thanks,
Dave

