我用加法子程序写了个程序,把0x01和0x04两个数相加送至RD口,但编译的时候总是说Symbol not previously defined (D_add),求好心人帮助我,程序去下。#INCLUDE<P16F877A.INC>
__CONFIG _DEBUG_OFF&_CP_ALL&_WRT_HALF&_CPD_ON&_LVP_OFF&_BODEN_OFF&_PWRTE_ON&_WDT_OFF&_HS_OSC;芯片配置字,看门狗关,上电延时开,掉电检测关,低压编程关,加密,4M晶体HS振荡
ACCALO EQU 20
ACCAHI EQU 21
ACCBLO EQU 23
ACCBHI EQU 24
ORG 00H
START GOTO MAIN
MAIN
MOVLW 00H
MOVWF PORTA
MOVWF PORTD
BSF STATUS,RP0
MOVLW 1FH
MOVWF TRISA
CLRF TRISD
MOVLW 06H
MOVWF ADCON1
BCF STATUS,RP0
MOVLW 0X01
MOVWF ACCALO
MOVLW 0X04
MOVWF ACCBLO
CALL D_add
MOVF ACCBLO
MOVWF PORTD
LOOP
GOTO LOOP
END
D_add MOVF ACCALO,0
ADDWF ACCBLO
BTFSC STATUS,C
INCF ACCBHI
MOVF ACCAHI,0
ADDWF ACCBHI
RETURN
NEG_A COMF ACCALO
INCF ACCALO
BTFSC STATUS,Z
COMF ACCAHI
RETURN |