adc r3,r5 (1) first case: carry flag is set r3=r3+r5+1 if adc does not exist, this is the same as inc r3 add r3,r5 ; carry bit is updated for the next operation (2) second case: carry flag is cleared r3=r3+r5 if adc does not exist, add r3,r5 Want to write general code to replace adc - conditional: don't want to add one if the carry flag is cleared! - need to execute the add instruction brcc l1 inc r3 l1: add r3,r5 ================================ want to do something 20 times sbi PORTA,2 cbi PORTA,2 useful instructions: ldi to initialize a register for countdown purposes dec to decrease the counter by one for each iteration breq or brne to utilize the Z flag after dec designate r16 as the counter ldi r16,20 ; initialize counter to 20 L1: sbi PORTA,2 cbi PORTA,2 dec r16 ; decrement the counter because we just performed one more iteration brne L1 brne L1 == rjmp L1 only if Z=0