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

我这个书上抄的汇编语言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 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog