ORG 00H
AJMP START
ORG 03H
AJMP INT0SUB
ORG 0030H
START:
MOV IE,#10000001B
MOV TCON, #00000001B
MOV SP,#20H
MOV A,#0FEH
RTT:
RR A
MOV P0,A
ACALL DELAY
AJMP RTT
DELAY:
MOV R3,#00H
DEL:
MOV R4,#00H
DJNZ R4,$
DJNZ R3,DEL
RET
INT0SUB:
PUSH PSW
PUSH A
SETB RS0
CLR RS1
MOV R1,#09H
LOOP:
MOV A,#0H
MOV P0,A
ACALL DELAY
MOV A,#0FFH
MOV P0,A
DJNZ R0,LOOP
POP A
POP PSW
RETI
END