Assuming I have a negative 8-bit number represented in 2 complement code, let's say -12, what number can I add to it to set all flags mentioned in the title (Zero, Negative, Overflow and Carry), or at least 3 of them?
My understanding now is that 8 bit 2 complement code can only represent numbers from -128 to 127, so when I have -12 I can add +12 and I will set the carry and zero flag. The other way would be to add a negative number to -12 that will be equal to a positive 8 bit number(e.g. -12-120), which means I will set my overflow and carry flags.
So is there a way to set all of the flags or at least three of them ?