Hello. I try to compare the next expressions:
1)
mov al, 4
mov bl, 12
sub al, bl ; CF == 1
0000 0100 (4)
+
1111 0100 (-12)
=
1111 1000 (-8 == 248)
2)
mov al, 4
mov bl, -12
add al, bl ; CF == 0
0000 0100 (4)
+
1111 0100 (-12)
=
1111 1000 (-8 == 248)
The results are identical, but carry flags are not. Why? The subtraction realized by addition to twos complement value.