错误:必须在MPLAB v4.50中使用PIC asm在适当的部分中定义可执行代码和数据

时间:2017-11-18 07:00:09

标签: assembly pic18

我正在使用代码,但是当我尝试运行时,我仍然遇到错误。我粘贴了下面的错误,我还添加了一个截图。谢谢你的帮助..

Title "PIC18F452"
List p=18F452, f =inhx32
#include <p18F452.inc>  ;This is a header file 

REG00   EQU 0x00            ;Register 00H is labeled as REG00
REG01   EQU 0x01            ;Register 01H is labeled as REG01
REG02   EQU 0x02            ;Register 02H is labeled as REG02
REG03   EQU 0x03            ;Register 03H is labeled as REG03
REG04   EQU 0x04            ;Register 04H is labeled as REG04
REG05   EQU 0x05            ;Register 05H is labeled as REG05
REG10   EQU 0x10            ;Register 10H is labeled as REG10

        MOVLW   0x11        ;Load the first Hex number 11H in WREG
        MOVWF   REG00       ;Store 11H in File Register 00H in data memory
        MOVWF   REG01       ;Store 11H in File Register 01H in data memory
        MOVWF   REG02       ;Store 11H in File Register 02H in data memory
        MOVWF   REG03       ;Store 11H in File Register 03H in data memory
        MOVWF   REG04       ;Store 11H in File Register 04H in data memory
        MOVWF   REG05       ;Store 11H in File Register 00H in data memory
        MOVWF   REG00       ;Store 11H in File Register 00H in data memory


        ADDWF   REG01, W     
        ADDWF   REG02, W     
        ADDWF   REG03, W    
        ADDWF   REG04, W    
        ADDWF   REG05, W    

        MOVWF   REG10       ;Save the sum in File Register 10H
        END

enter image description here

"C:\Program Files (x86)\Microchip\MPLABX\v4.05\mpasmx\mpasmx.exe" -d__DEBUG -d__MPLAB_DEBUGGER_SIMULATOR=1 -q -p18f452 -l"build/default/debug/addingnumber.lst" -e"build/default/debug/addingnumber.err" -o"build/default/debug/addingnumber.o" "addingnumber.asm"
 make[1]: *** [.build-conf] 
 Error 2
 Error[152]
 C:\USERS\INTEL\MPLABXPROJECTS\PROGRAM1.X\ADDINGNUMBER.ASM 13 : Executable code and data must be defined in an appropriate section
 Error[152]
 C:\USERS\INTEL\MPLABXPROJECTS\PROGRAM1.X\ADDINGNUMBER.ASM 14 : Executable code and data must be defined in an appropriate section 

0 个答案:

没有答案