A51 MACRO ASSEMBLER 謃断系统的觃用__一__ 05/03/2008 17:55:42 PAGE 1
MACRO ASSEMBLER A51 V7.07
OBJECT MODULE PLACED IN 中断系统的应用(一).OBJ
ASSEMBLER INVOKED BY: C:\Keil\C51\BIN\A51.EXE 中断系统的应用(一).ASM SET(SMALL) DEBUG EP
LOC OBJ LINE SOURCE
0000 1 ORG 00H
0000 0105 2 AJMP START
0003 3 ORG 03H
0003 0121 4 AJMP INT
0005 D2A8 5 START: SETB EX0
0007 D288 6 SETB IT0
0009 D2AF 7 SETB EA
000B 758170 8 MOV SP,#70H
000E 90004E 9 LP: MOV DPTR,#TABLE ;TABLE表的地址存入DPTR
0011 7400 10 LP0: MOV A,#00H ;清除累加器
0013 93 11 LP1: MOVC A,@A+DPTR ;查表
0014 B41B02 12 CJNE A,#1BH,LP2 ;取出的代码不是结束码,则进行下一步操作
0017 010E 13 AJMP LP ;是结束码,则重新进行操作
0019 F580 14 LP2: MOV P0,A ;将A中的值送P1口,显示
001B 120041 15 LCALL DELAY ;等待1s
001E A3 16 INC DPTR ;数据指针加1,指向下1个码
001F 0111 17 AJMP LP0 ;返回,取码
0021 C0E0 18 INT: PUSH ACC
0023 C0D0 19 PUSH PSW
0025 D2D3 20 SETB RS0
0027 C2D4 21 CLR RS1
0029 900067 22 MOV DPTR,#TABLE1
002C 7400 23 INTLP1:MOV A,#00H
002E 93 24 MOVC A,@A+DPTR
002F B41B02 25 CJNE A,#1BH,INTLP2
0032 013C 26 AJMP INTLP3
0034 F580 27 INTLP2:MOV P0,A
0036 120041 28 LCALL DELAY
0039 A3 29 INC DPTR
003A 012C 30 AJMP INTLP1
003C D0D0 31 INTLP3:POP PSW
003E D0E0 32 POP ACC
0040 32 33 RETI
0041 7F0A 34 DELAY: MOV R7,#10 ;1s延时子程序
0043 7EC8 35 DE1: MOV R6,#200
0045 7DF8 36 DE2: MOV R5,#248
0047 DDFE 37 DJNZ R5,$
0049 DEFA 38 DJNZ R6,DE2
004B DFF6 39 DJNZ R7,DE1
004D 22 40 RET
004E FEFDFBF7 41 TABLE: DB 0feH,0fdH,0fbH,0f7H ;正向流水灯
0052 EFDFBF7F 42 DB 0efH,0dfH,0bfH,07fH
0056 BFDFEFF7 43 DB 0bfH,0dfH,0efH,0f7H ;反向流水灯
005A FBFDFEFF 44 DB 0fbH,0fdH,0feH,0ffH
005E AA55AA55 45 DB 0aaH,55H,0aaH,55H ;隔灯闪烁
0062 AA55FF 46 DB 0aaH,55H,0ffH
0065 1B 47 DB 1BH ;退出码
0066 22 48 RET
0067 FF00FF00 49 TABLE1:DB 0FFH,00H,0FFH,00H,0FFH,00H;闪烁5次
006B FF00
006D FF00FF00 50 DB 0FFH,00H,0FFH,00H,1BH
0071 1B
0072 22 51 RET
52 END
A51 MACRO ASSEMBLER 謃断系统的觃用__一__ 05/03/2008 17:55:42 PAGE 2
SYMBOL TABLE LISTING
------ ----- -------
N A M E T Y P E V A L U E ATTRIBUTES
ACC. . . . . . . . D ADDR 00E0H A
DE1. . . . . . . . C ADDR 0043H A
DE2. . . . . . . . C ADDR 0045H A
DELAY. . . . . . . C ADDR 0041H A
EA . . . . . . . . B ADDR 00A8H.7 A
EX0. . . . . . . . B ADDR 00A8H.0 A
INT. . . . . . . . C ADDR 0021H A
INTLP1 . . . . . . C ADDR 002CH A
INTLP2 . . . . . . C ADDR 0034H A
INTLP3 . . . . . . C ADDR 003CH A
IT0. . . . . . . . B ADDR 0088H.0 A
LP . . . . . . . . C ADDR 000EH A
LP0. . . . . . . . C ADDR 0011H A
LP1. . . . . . . . C ADDR 0013H A
LP2. . . . . . . . C ADDR 0019H A
P0 . . . . . . . . D ADDR 0080H A
PSW. . . . . . . . D ADDR 00D0H A
RS0. . . . . . . . B ADDR 00D0H.3 A
RS1. . . . . . . . B ADDR 00D0H.4 A
SP . . . . . . . . D ADDR 0081H A
START. . . . . . . C ADDR 0005H A
TABLE. . . . . . . C ADDR 004EH A
TABLE1 . . . . . . C ADDR 0067H A
REGISTER BANK(S) USED: 0
ASSEMBLY COMPLETE. 0 WARNING(S), 0 ERROR(S)