Source Code:

    

      
;.INCLUDE "M32DEF.INC" SBI DDRB,0 SBI DDRB,1 SBI DDRB,2 SBI DDRB,3 CBI DDRA,7 MONITOR: SBIS PINA,7 RJMP CLKWISE CBI DDRB,1 CBI DDRB,2 SBI DDRB,0 SBI DDRB,3 JMP MONITOR CLKWISE: CBI DDRB,0 CBI DDRB,3 SBI DDRB,1 SBI DDRB,2 JMP MONITOR