/*
* Example16_2Asm.asm
*
* Created: 05/26/2017 11:08:56
* Author: Naimi
*/
SBI DDRB,0 ;make PB0 an output (Enable)
SBI DDRB,1 ;make PB1 an output (clock)
SBI DDRB,2 ;make PB2 an output (counter)
SBI PORTB,0 ;Enable = 1
CBI DDRD,7 ;make PD7 an input
SBI PORTD,7
MONITOR: SBIS PIND,7 ;skip next if PIND.7 is set
RJMP CLKWISE ;if PD7 = 0 go to CLKWISE
CBI PORTB,1 ;switch1 = 0
SBI PORTB,2 ;switch2 = 1
JMP MONITOR
CLKWISE: SBI PORTB,1 ;switch1 = 1
CBI PORTB,2 ;switch2 = 0
JMP MONITOR