Microchip
直播中

朱志兴

7年用户 298经验值
私信 关注
[问答]

获取PHASE ERROR,如何在MPLAB X IDE中将包含文件指定为汇编代码?

我把下面的示例.ASM作为项目中的源文件之一,但是我在汇编指令(NOP)上得到了“相位错误”。3个NOP指令被标记为错误:(840)相位错误,什么是相位误差和/或我可以在哪里查找错误解释?-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------预文件,它似乎已经失去了缩进和空格。我不确定A.Primefile应该是什么样子,所以我首先在记事本++中编辑了.ASM文件,以将所有标签隐藏到空格中,但这无济于事。在这次运行中,我改变了NOPS到所有的上限,但这无济于事。这里是预文件:结束

以上来自于百度翻译


      以下为原文

    I've added the following Example.asm as one of the source files in the project but I'm getting "phase error" on the assembly instructions (nop).
PROG    CODE        ; Set the start of code from 16f84a.lkr scriptmain                ; Min code entry called from Example2.asm
    global  main    ; Define as global so can be used in Example2.asm
    nop             ; Main does nothing -- Put your code here
    goto    main    ; Our sample "main" is just an infinite loopservice             ; Interrupt routine, called from Example2.asm
    global service  ; Define as global so can be used in Example2.asm
    nop             ; Interrupt code would go here
    nop
    retfie
    endThe 3 nop instructions are tagged as error: (840) phase error
What is a phase error and/or where can I look up error explanations?
-------------------------------------------------------------------
If I look at the Example.pre file it appears to have lost indenting and spaces.  I'm not sure what a .pre file is supposed to look like so at first I edited the .ASM file in Notepad++ to covert all tabs to spaces but that didn't help.  In this run I changed the nops to all CAPS but that didn't help.  Here is the .pre file:  
# 1 "Example.asm"
PROG CODE ; Set the start of code from 16f84a.lkr scriptmain ; Min code entry called from Example2.asm
global main ; Define as global so can be used in Example2.asm
NOP ; Main does nothing -- Put your code here
goto main ; Our sample "main" is just an infinite loopservice ; Interrupt routine, called from Example2.asm
global service ; Define as global so can be used in Example2.asm
NOP ; Interrupt code would go here
NOP
retfie
end

回帖(7)

陈晨

2018-10-8 10:08:13
哪个编译器?哪一张照片?

以上来自于百度翻译


      以下为原文

    Which compiler? Which PIC?
举报

张丽

2018-10-8 10:24:06
你用“Simult.ASM”开头的文件是针对PIC16F87的,所以文件“ExpRe2.2.ASM”。你的帖子中的另一行暗示你可能对PIC16F84A DeViCe感兴趣。我已经为PIC16F84A附上了MPLABX项目,希望能有所帮助。

以上来自于百度翻译


      以下为原文

   
The file you have started with "EXAMPLE.ASM' is targeted for a PIC16F887 so is the file "EXAMPLE2.ASM".
 
Another line in your post suggests that you may be interested in code for a PIC16F84A devcie.
 
I have attached an MPLABX project for a PIC16F84A in the hope it may be of some help.
   Attachment(s)

16F84A_template.zip (7.00 KB) - downloaded 0 times
举报

陈鲜孰

2018-10-8 10:30:13
这是XC8C编译器工具包的ASPIC汇编程序中的一个错误:ASPIC不兼容*MPASM。如果您只想组装MPASM SOIURCE文件,请使用MICICROCHAMP MPASM工具包。你不能将MPASM源文件(.ASM)和XC8C源混合到同一个程序中。如果你想将汇编与XC8C源混合使用,你需要使用ASPIC汇编程序,但是它有几个语法差异和不同的汇编指令,所以要转换MPASM源有很多工作。

以上来自于百度翻译


      以下为原文

    That's an error from the XC8 C compiler toolsuite's ASPIC assembler:

ASPIC is *NOT* MPASM compatible.  If you just want to assemble MPASM soiurce files use the Microchip MPASM Toolsuite.  You cant mix MPASM source files (.asm) with XC8 C source in the same program.   If you want to mix assembly with XC8 C source you need to use the ASPIC assembler, but it has several syntax differences and very different assembler directives, so its a lot of work to convert MPASM source.
举报

李兆水

2018-10-8 10:42:08
啊哈,好的。击中头部的钉子!我宁愿使用MPASM,无论如何,我有几百个.ASM库例程我一直在使用,但是这次我需要使用PIC16F1613,并且我找不到任何地方的P16F1613C头文件。我使用不包括16F16XX系列的通用P16XXX.C文件吗?

以上来自于百度翻译


      以下为原文

    Ah ha, OK.  Hit the head on the nail!  wink:
 
I would prefer to use MPASM anyhow, I have hundreds of .ASM library routines I've been using but this time I need to use the PIC16F1613 and I can't find a p16f1613.inc header file anywhere. 
Do I use the generic p16xxx.inc file which doesn't include the 16F16xx series?
举报

更多回帖

发帖
×
20
完善资料,
赚取积分