CLRV macro sets C
Jon Abbott (1421) 2651 posts |
Why does this macro set C on the Pi build? It encodes to the following (spotted in Finalise_Module of SoundDMA): MSR CPSR_f,#&20000000 Is that a bug or by design? |
Jeffrey Lee (213) 6048 posts |
It’s intentional. The original 26bit version does CMP PC,#0, which would result in nzCv being set. To avoid any potential side-effects the 32bit version is careful to copy the behaviour exactly. |
Jon Abbott (1421) 2651 posts |
Ah, that may be the reason why some OS_Byte mysteriously set C. EDIT: My notes on OS_Byte C flag corruption, from a partial check of behaviour in RISCOS 3.11: 0..4 – clear C |
Rick Murray (539) 13840 posts |
Sometimes that’s done on purpose to flag something happened, like key was pressed… |