是在microchip网站上下载的an967(用pic16f72驱动单相交流电机)的原代码
压缩包里面包括一个asm 和一个inc文件
我用mplab 8.1 (网站上下的次新稳定版) 编译
报错,内容如下:
----------------------------------------------------------------------
release build of project `e:\pic test\1\1.mcp' started.
fri jul 04 11

28 2008
----------------------------------------------------------------------
make: the target "e:\pic test\1\mc_16f72.o" is out of date.
executing: "c:\program files\microchip\mpasm suite\mpasmwin.exe" /q /p16f72 "mc_16f72.asm" /l"mc_16f72.lst" /e"mc_16f72.err" /x"mc_16f72.xrf" /ainhx8m
error[149] e:\pic test\1\mc_16f72.asm 76 : directive only allowed when generating an object file
error[149] e:\pic test\1\mc_16f72.asm 79 : directive only allowed when generating an object file
error[149] e:\pic test\1\mc_16f72.asm 83 : directive only allowed when generating an object file
message[302] e:\pic test\1\mc_16f72.asm 89 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 91 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 118 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 120 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 135 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 141 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 144 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 733 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 734 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 750 : register in operand not in bank 0. ensure that bank bits are correct.
error[149] e:\pic test\1\mc_16f72.asm 900 : directive only allowed when generating an object file
halting build on first failure as requested.
----------------------------------------------------------------------
release build of project `e:\pic test\1\1.mcp' failed.
fri jul 04 11

30 2008
----------------------------------------------------------------------
build failed
然后我根据error 149 就改成输出build library target (invoke mplib)
这次编译成功了 但是按照help 此种只能生成.o文件 也确实生成了一个.o文件
但是下一步该怎样做呢? 怎么才能生成 hex文件呢 晕了
----------------------------------------------------------------------
debug build of project `e:\pic test\1\1.mcp' started.
preprocessor symbol `__debug' is defined.
fri jul 04 11

15 2008
----------------------------------------------------------------------
make: the target "e:\pic test\1\mc_16f72.o" is out of date.
executing: "c:\program files\microchip\mpasm suite\mpasmwin.exe" /q /p16cxx "mc_16f72.asm" /l"mc_16f72.lst" /e"mc_16f72.err" /o"mc_16f72.o" /d__debug=1 /x"mc_16f72.xrf" /ainhx8m
message[301] c:\program files\microchip\mpasm suite\p16f72.inc 35 : message: (processor-header file mismatch. verify selected processor.)
message[302] e:\pic test\1\mc_16f72.asm 89 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 91 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 118 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 120 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 135 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 141 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 144 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 733 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 734 : register in operand not in bank 0. ensure that bank bits are correct.
message[302] e:\pic test\1\mc_16f72.asm 750 : register in operand not in bank 0. ensure that bank bits are correct.
make: the target "e:\pic test\1\1.cof" is out of date.
executing: "c:\program files\microchip\mpasm suite\mplib.exe" /c "1.lib" "mc_16f72.o"
mplib 4.20, librarian
copyright (c) 2008 microchip technology inc.
errors : 0
----------------------------------------------------------------------
debug build of project `e:\pic test\1\1.mcp' succeeded.
preprocessor symbol `__debug' is defined.
fri jul 04 11

19 2008
----------------------------------------------------------------------
build succeeded