qq_38423382 2017-09-08 11:29 采纳率: 0%
浏览 1772
已采纳

我这个书上抄的汇编语言pic16f877代码有问题吗,为啥一直编译过不了

  list      p=16f877
  include   "p16f877.inc"
  org       0x00
  nop

Start: banksel PORTC
clrf PORTC
movlw B'01000001'
movwf ADCONO
banksel OPTION_REG
clrf TRISC
movlw B'00001110'
movwf ADCON1
banksel PORTC
Main: btfss INTCON,TOIF
goto Main
bcf INTCON,TOIF
bsf ADCONO,GO
Wait

btfss PIR1,ADIF
goto Wait
movf ADRESH,W
movwf PORTC
goto Main
end
我build之后显示这个
----------------------------------------------------------------------
Debug build of project G:\project\adc.mcp' started.
Language tool versions: MPASMWIN.exe v5.37, mplink.exe v4.37, mplib.exe v4.37
Preprocessor symbol
__DEBUG' is defined.

Fri Sep 08 19:27:24 2017

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "G:\MPLAB\MPASM Suite\MPASMWIN.exe" /q /p16F877A "adc.asm" /l"adc.lst" /e"adc.err" /d__DEBUG=1
Message[301] G:\MPLAB\MPASM SUITE\P16F877.INC 37 : MESSAGE: (Processor-header file mismatch. Verify selected processor.)
Error[121] G:\PROJECT\ADC.ASM 5 : Illegal label (Start)
Error[113] G:\PROJECT\ADC.ASM 8 : Symbol not previously defined (ADCONO)
Message[302] G:\PROJECT\ADC.ASM 10 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] G:\PROJECT\ADC.ASM 12 : Register in operand not in bank 0. Ensure that bank bits are correct.
Error[113] G:\PROJECT\ADC.ASM 14 : Symbol not previously defined (TOIF)
Error[113] G:\PROJECT\ADC.ASM 16 : Symbol not previously defined (TOIF)
Error[113] G:\PROJECT\ADC.ASM 17 : Symbol not previously defined (ADCONO)

Halting build on first failure as requested.

Debug build of project G:\project\adc.mcp' failed.
Language tool versions: MPASMWIN.exe v5.37, mplink.exe v4.37, mplib.exe v4.37
Preprocessor symbol
__DEBUG' is defined.

Fri Sep 08 19:27:25 2017

BUILD FAILED

  • 写回答

1条回答

  • threenewbee 2017-09-08 13:03
    关注

    没听说代码用抄的,你的书没有配套源代码么?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题