(大杂烩)proteus仿真MCS51一百例
源代码在线查看: 8255(2).lst
A51 MACRO ASSEMBLER 8255_2_ 07/25/2006 13:26:46 PAGE 1
MACRO ASSEMBLER A51 V8.00
OBJECT MODULE PLACED IN 8255(2).OBJ
ASSEMBLER INVOKED BY: e:\Program Files\Keil\C51\BIN\A51.EXE 8255(2).asm SET(SMALL) DEBUG EP
LOC OBJ LINE SOURCE
0000 1 ORG 00H
7CFF 2 PORTA EQU 7CFFH ;A口
7DFF 3 PORTB EQU 7DFFH ;B口
7EFF 4 PORTC EQU 7EFFH ;C口
7FFF 5 CADDR EQU 7FFFH ;控制字地址
0000 802E 6 SJMP START
0030 7 ORG 30H
0030 7482 8 START: MOV A,#82H ;方式0,PA,PC输出,PB输入
0032 907FFF 9 MOV DPTR,#CADDR
0035 F0 10 MOVX @ DPTR,A
0036 907DFF 11 MOV DPTR,#PORTB
0039 E0 12 MOVX A,@ DPTR ;读入B口
003A 907CFF 13 MOV DPTR,#PORTA
003D F0 14 MOVX @DPTR,A ;输出到A口
003E 1143 15 CALL DELAY
0040 020030 16 LJMP START
0043 7E00 17 DELAY: MOV R6,#0
0045 7F00 18 MOV R7,#0
0047 19 DELAYLOOP:
0047 DEFE 20 DJNZ R6,DELAYLOOP
0049 DFFC 21 DJNZ R7,DELAYLOOP
004B 22 22 RET
23 END
A51 MACRO ASSEMBLER 8255_2_ 07/25/2006 13:26:46 PAGE 2
SYMBOL TABLE LISTING
------ ----- -------
N A M E T Y P E V A L U E ATTRIBUTES
CADDR. . . . . . . N NUMB 7FFFH A
DELAY. . . . . . . C ADDR 0043H A
DELAYLOOP. . . . . C ADDR 0047H A
PORTA. . . . . . . N NUMB 7CFFH A
PORTB. . . . . . . N NUMB 7DFFH A
PORTC. . . . . . . N NUMB 7EFFH A
START. . . . . . . C ADDR 0030H A
REGISTER BANK(S) USED: 0
ASSEMBLY COMPLETE. 0 WARNING(S), 0 ERROR(S)