Bueno, es muy sencillo, aca tenes, modifica y/o cambia lo que quieras a gusto.
Código:
;/////Configuramos todo////
bsf STATUS,RP0 ; banco 1
molvw 0x01 ; RA0 entrada, lo demas salidas
movwf TRISA
clrf TRISB
bcf STATUS,RP0 ;banco 0
;////Principal/////
main call Escanea_Tecla ;A pull Down con una resistencia de 10k
goto main
Escanea_Tecla
BTFSC PORTA,0 ;Salta si es 0
goto ENCIENDE_LED
goto APAGA_LED
return
ENCIENDE_LED
bsf PORTB,0
goto Escanea_Tecla
APAGA_LED
bcf PORTB,0
goto Escanea_Tecla
end
Saludos
__________________
Código Delphi
[-]
try
ProgramarMicro(80C52,'Intel',MnHex,True);
except
On Exception do
MicroChip.IsPresent(True);
end;