in wich modes ROR overwrites original data?
Posted: Thu Aug 19, 2010 8:33 pm
...that's what i'm wondering now while looking at the ROR behavior.
e.g.: ROR Accumulator:
but it's only that? or i'm missing the...:
...final line?
in that case, flags are setted/reseted relying on the accumulator's (or whatever the source is) final value? or is it correct to change the flags BEFORE the original data gets overwriten?
e.g.: ROR Accumulator:
Code: Select all
byte src; // just an unsigned 8-bit number
src = (ACC >> 1); // store the rotation temporary
if(C_FLAG) src |= 0x80; // if C was set, then set the #7 bit of the rotation's result
C_FLAG = ACC & 0x1;
Z_FLAG = !(src);
N_FLAG = !!(src & 0x80);Code: Select all
ACC = src;in that case, flags are setted/reseted relying on the accumulator's (or whatever the source is) final value? or is it correct to change the flags BEFORE the original data gets overwriten?