I want to simply assign (copy) a bit in the IO register from some other register bit (or flag, or as a result of some comparison). Now I am using following (PORTD[2] := r0[3]
):
sbrc r0, 3 ; Skip if Bit in Register is Cleared
sbi PORTD, 2 ; Set Bit in I/O Register
sbrs r0, 3 ; Skip if Bit in Register is Set
cbi PORTD, 2 ; Clear Bit in I/O Register
But is it optimal? Is there better way? How to make it with other sources - some flag for example C or T?
sbrc
. \$\endgroup\$