I understand that to set them, we need to append the S, e.g.
ADDS R0,R1,R2
which will for example, set C if the result overflows.
- Am I correct in saying:
another line of code subsequent to the previous line such as:
SUB R3,R4,R5
will make NO CHANGES whatsoever to the condition flags? (due to the lack of S )
Subsequently, the next change in condition flags, regardless of the #lines of code can ONLY happen in the next line with the operation that has S appended?
Furthermore, the previous state of the condition flag bits make no effect on how the condition flags are set as they will be cleared or set depending entirely on the result of the current operation.
What if the result of the current operation does not affect some condition bits? For example
ANDS R0,R1,R2
only have N,Z flags relevant to them as the result cannot generate a carry C or a signed overflow Z. In such a case, will the C,Z flags be preserved or cleared?
To see when they are set is straightforward, but I find the lectures and books I am looking at very vague in describing precisely when they can get cleared so I asked a question here to get something concrete.