ORG 0000H
LJMP MAIN
ORG 0003H
LJMP INT00
ORG 0013H
LJMP INT11
ORG 0030H
MAIN:SETB PX0
MOV TCON,#00H
MOV IE,#85H
LOOP:MOV P1,#0F3H
MOV R1,#88
AP1:LCALL DELAY
DJNZ R1,AP1
MOV R1,#6
AP2:CPL P1.2
LCALL DELAY
DJNZ R1,AP2
MOV P1,#0F5H
MOV R1,#6
AP3:LCALL DELAY
DJNZ R1,AP3
MOV P1,#0DEH
MOV R1,#48
BP1:LCALL DELAY
DJNZ R1,BP1
MOV R1,#6
BP2:CPL P1.5
LCALL DELAY
DJNZ R1,BP2
MOV P1,#0EEH
MOV R1,#6
BP3:LCALL DELAY
DJNZ R1,BP3
SJMP LOOP
ORG 0200H
INT00:PUSH P1
MOV P1,#0F6H
MOV R2,#30
DELAY0:LCALL DELAY
DJNZ R2,DELAY0
POP P1
RETI
ORG 0300H
INT11:CLR EA
PUSH P1
PUSH 04H
PUSH 05H
PUSH 06H
SETB EA
JNB P3.0,AP0
MOV P1,#0F3H
SJMP DEL1
AP0:JNB P3.1,EXIT
MOV P1,#0DEH
DEL1:MOV R3,#30
NEXT:LCALL DELAY
DJNZ R3,NEXT
EXIT:CLR EA
POP 06H
POP 05H
POP 04H
POP P1
SETB EA
RETI
ORG 0350H
DELAY:MOV R4,#10
LP1:MOV R5,#50
LP2:MOV R6,#248
NOP
LP3:DJNZ R6,LP3
DJNZ R5,LP2
DJNZ R4,LP1
RET
END