自己编的汇编程序出现这个错误:6.1.asm(55): error A48: DATA-ADDRESS EXPECTED 大神们帮忙看看
时间:10-02
整理:3721RD
点击:
代码如下:
AD_VALUE_HIGH4 EQU 30H
AD_VALUE_LOW8 EQU 31H
LED_STATUS EQU 32H
ICL7109_LBEN EQU P2.4
ICL7109_HBEN EQU P2.5
ICL7109_CE EQU P2.6
ICL7109_RUN EQU P2.7
LED EQU P2.3
LED2_SELECT EQU P3.7
LED1_SELECT EQU P3.6
LED0_SELECT EQU P3.5
ORG 0000H
SJMP MAIN
ORG 000BH
AJMP TIMER0_SERVICE
ORG 001BH
AJMP INT1_SERVICE
ORG 0023H
DS 3
ORG 0030H
MAIN:
MOV SP, #40H
ACALL INIT_ICL7109
ACALL INIT_TIMER0
SETB EA
LOOP:
NOP
NOP
SJMP LOOP
INIT_ICL7109:
CLR ICL7109_CE
SETB ICL7109_RUN
SETB IT1
SETB EX1
RET
INIT_TIMER0:
MOV TMOD, #01H
MOV TH0, #0F8H
MOV TL0, #0CCH
SETB ET0
SETB TR0
MOV LED_STATUS, #00H
RET
INT1_SERVICE:
CLR ICL7109_HBEN
SETB ICL7109_LBEN
NOP
MOV AD_VALUE_HIGH4, ICL7109_HBEN;错误指向这里
SETB ICL7109_HBEN
CLR ICL7109_LBEN
NOP
MOV AD_VALUE_LOW8, ICL7109_LBEN;错误指向这里
CPL LED
RETI
TIMER0_SERVICE:
MOV TL0, #0CCH
MOV TH0, #0F8H
PUSH ACC
MOV A, LED_STATUS
CJNE A, #00H,NEXT1
SETB LED2_SELECT
CLR LED0_SELECT
MOV A, AD_VALUE_LOW8
ANL A, #0FH
MOV DPTR, #TAB
MOVC A, @A+DPTR
MOV P1, A
MOV LED_STATUS, #01H
SJMP EXIT
NEXT1:
CJNE A, #01H, NEXT2
SETB LED0_SELECT
CLR LED1_SELECT
MOV A, AD_VALUE_LOW8
SWAP A
ANL A, #0FH
MOV DPTR, #TAB
MOVC A, @A+DPTR
MOV P1, A
MOV LED_STATUS, #02H
SJMP EXIT
NEXT2:
SETB LED1_SELECT
CLR LED2_SELECT
MOV A, AD_VALUE_HIGH4
ANL A, #0FH
MOV DPTR, #TAB
MOVC A, @A+DPTR
MOV P1, A
MOV LED_STATUS, #00H
EXIT:
POP ACC
RETI
TAB:
DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H
DB 80H,90H,88H,83H,0A7H,0A1H,86H,8EH
END
AD_VALUE_HIGH4 EQU 30H
AD_VALUE_LOW8 EQU 31H
LED_STATUS EQU 32H
ICL7109_LBEN EQU P2.4
ICL7109_HBEN EQU P2.5
ICL7109_CE EQU P2.6
ICL7109_RUN EQU P2.7
LED EQU P2.3
LED2_SELECT EQU P3.7
LED1_SELECT EQU P3.6
LED0_SELECT EQU P3.5
ORG 0000H
SJMP MAIN
ORG 000BH
AJMP TIMER0_SERVICE
ORG 001BH
AJMP INT1_SERVICE
ORG 0023H
DS 3
ORG 0030H
MAIN:
MOV SP, #40H
ACALL INIT_ICL7109
ACALL INIT_TIMER0
SETB EA
LOOP:
NOP
NOP
SJMP LOOP
INIT_ICL7109:
CLR ICL7109_CE
SETB ICL7109_RUN
SETB IT1
SETB EX1
RET
INIT_TIMER0:
MOV TMOD, #01H
MOV TH0, #0F8H
MOV TL0, #0CCH
SETB ET0
SETB TR0
MOV LED_STATUS, #00H
RET
INT1_SERVICE:
CLR ICL7109_HBEN
SETB ICL7109_LBEN
NOP
MOV AD_VALUE_HIGH4, ICL7109_HBEN;错误指向这里
SETB ICL7109_HBEN
CLR ICL7109_LBEN
NOP
MOV AD_VALUE_LOW8, ICL7109_LBEN;错误指向这里
CPL LED
RETI
TIMER0_SERVICE:
MOV TL0, #0CCH
MOV TH0, #0F8H
PUSH ACC
MOV A, LED_STATUS
CJNE A, #00H,NEXT1
SETB LED2_SELECT
CLR LED0_SELECT
MOV A, AD_VALUE_LOW8
ANL A, #0FH
MOV DPTR, #TAB
MOVC A, @A+DPTR
MOV P1, A
MOV LED_STATUS, #01H
SJMP EXIT
NEXT1:
CJNE A, #01H, NEXT2
SETB LED0_SELECT
CLR LED1_SELECT
MOV A, AD_VALUE_LOW8
SWAP A
ANL A, #0FH
MOV DPTR, #TAB
MOVC A, @A+DPTR
MOV P1, A
MOV LED_STATUS, #02H
SJMP EXIT
NEXT2:
SETB LED1_SELECT
CLR LED2_SELECT
MOV A, AD_VALUE_HIGH4
ANL A, #0FH
MOV DPTR, #TAB
MOVC A, @A+DPTR
MOV P1, A
MOV LED_STATUS, #00H
EXIT:
POP ACC
RETI
TAB:
DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H
DB 80H,90H,88H,83H,0A7H,0A1H,86H,8EH
END
汇编不能直接把引脚的值给变量的
那请问应该是? 我刚学不知怎么改
clr a
mov c,ICL7109_HBEN
mov acc.0,c
这里读入ICL7109_HBEN引脚,并把值赋给ACC.0,不过你这里有错误吧,你这里应该是读ICL7109的数据,但是ICL7109的数据位接到单片机哪里呢
我这个程序是实验的填空题 MOV AD_VALUE_HIGH4,_______ 我填了ICL7109_HBEN 所以不知怎么改
我这个程序是实验的填空题 MOV AD_VALUE_HIGH4,_______ 我填了ICL7109_HBEN 所以不知怎么改
可以了,就前面伪指令已经定义了那引脚了