|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
ORG 0000H;
LJMP MAIN;
ORG 0003H;
LJMP INT_S0;
ORG 0013H;
LJMP INT_S1;
ORG 0100H;
MAIN:ANL P1,#0FFH;
SETB EA
SETB EX0;
SETB EX1;
CLR PX0;
CLR PX1;
SETB IT0;
SETB IT1;
MOV A,#0FEH;
LOOP: MOV P1,A
LCALL DELAY;
RL A;
SJMP LOOP;
INT_S0:MOV R3,A
MOV R2,#10;
XX1:MOV A,#0FH;
MOV P1,A;
LCALL DELAY;
MOV A,#0F0H;
MOV P1,A;
LCALL DELAY;
DJNZ R2,XX1;
MOV A,R3
RETI;
INT_S1:PUSH ACC;
MOV R4,#0AH;
XX2:MOV A,#0FFH;
MOV P1,A;
LCALL DELAY;
MOV A,#00H;
MOV P1,A;
LCALL DELAY;
DJNZ R4,XX2;
POP ACC;
MOV P1,ACC;
RETI;
DELAY:MOV R7,#6;
DEL1:MOV R6,#100;
DEL2:MOV R5,#248;
DJNZ R5,$;
DJNZ R6,DEL2;
DJNZ R7,DEL1;
RET;
END; |
|