Am having a problem understanding the indication of C and V Flags in the CPU Flags register.
For a C-Flag, its set when we genrate a carry or a borrow on the MSB. I think i understnad how its generated. However, am having a problem knowing what it indicates for the result of any arithmetic calculation.
My Tutor says that if C = 1, then the result of the addition or subtraction is wrong if we are dealing with an unsigned number.
I still dont undestand which is the unsigned number. Is it one of the two numbers that are being added or subtracted? what if one of them is negative and we generate C = 1, which is the number being referenced? Or is it the result?
I dont understnad why a V-Flag is generated in this case
90 - 55
0101 1010
- 1100 1001 (two's complement of 55)
-------------------
1001 0001 (-111)
N = 1, Z = 0, C = 1, V = 1