Include 'M64DEF.INC'
ORG 0X0000
JMP main
ORG 0X0050
main:
LDI R16,0X00
OUT DDRA,R16
LDI R16,0X0FF
OUT DDRB,R16
OUT DDRC,R16

LOOP:
IN R17,PINA
CPI R17,3
BRCS NOT_IN_RANGE
CPI R17,101
BRCC NOT_IN_RANGE
MOV R18,R17

CHECK_SQ:
LDI R19,2

CHEK:
MUL R19,R19
CP R0,R18
BREQ IS_SQ
CPI R19,11
BREQ NOT_SQ
INC R19
JMP CHECK

NOT_IN_RANGE:
OUT PORTB,R17
JMP LOOP

IS_SQ:
OUT PORTB,R17
JMP LOOP

NOT-SQ:
LDI R20,100
SUB R20,R17
OUT PORTC,R20
JMP LOOP
















   