$MOD51 CSEG ORG 4000H LJMP START ORG 4003H LJMP INTER0 ORG 4013H LJMP INTER1 ORG 4100H INTER0: MOV P1,#00H SETB P1.0 LCALL LDELAY CLR P1.0 RETI INTER1: MOV P1,#0H SETB P1.7 LCALL LDELAY CLR P1.7 RETI ORG 4200H LDELAY: PUSH 7 PUSH 6 PUSH 5 MOV R7,#24H LUPA: MOV R6,#0FFH LUPB: MOV R5,#0FFH DJNZ R5,$ DJNZ R6,LUPB DJNZ R7,LUPA POP 5 POP 6 POP 7 RET SDELAY: PUSH 7 PUSH 6 PUSH 5 MOV R7,#04H LUP1: MOV R6,#0FFH LUP2: MOV R5,#0FFH DJNZ R5,$ DJNZ R6,LUP2 DJNZ R7,LUP1 POP 5 POP 6 POP 7 RET START: MOV SP,#30H MOV TCON,#05H MOV IP,#04H MOV IE,#85H LOOP1: MOV P1,#01010101B ACALL SDELAY MOV P1,#10101010B ACALL SDELAY SJMP LOOP1 END
Rabu, 19 Januari 2011
Interrupt Dengan Prioritas
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar