i wrote this to turn on a Led connected to portd,0 when portb,0 it pushed but this does not work. why is that ?
#include <p18F4520.inc>
CONFIG OSC=HS , WDT=OFF , LVP=OFF , PBADEN=OFF
porta equ 0xf80 ;port and tris adress
trisa equ 0xf92
portb equ 0xf81
trisb equ 0xf93
portc equ 0xf82
trisc equ 0xf94
trisd equ 0xf95
portd equ 0xf83
intcon equ 0xff2
;************************************************************
org 0h
goto main
;***************************INTRRUPT
org 0008h
btfss intcon,4 ;int0ie check
retfie ;no, go to main
goto int0isr ;yes goto into isr0
;****************************************************MAIN PROG
org 00100h
main: bcf trisd,0 ;output
bsf trisb,0 ;into = input
bsf intcon,4 ;enable int0 interrupt
bsf intcon,7 ;globle int enable
h: bsf portd,0
bra h
;****************************************************ISR
int0isr:
org 200h
bcf portd,0
bcf intcon,4 ;clear int0 flag
retfie ;return from isr
end