使用NASM编译PIC程序集

时间:2013-07-17 14:45:42

标签: assembly nasm pic

我希望用Ubuntu 12.04和NASM在netbook上编译asm文件。 我尝试使用以下命令获取十六进制:nasm -f elf myFile.asm。 asm文件用于PIC16F628A。

这里是myFile.asm的内容:

http://pastebin.com/Rmaqhuv0

那里,我得到的一部分错误......

zeroKey.asm:6: error: parser: instruction expected
zeroKey.asm:7: error: label or instruction expected at start of line
zeroKey.asm:8: error: parser: instruction expected
zeroKey.asm:14: error: parser: instruction expected
zeroKey.asm:15: error: parser: instruction expected
zeroKey.asm:16: error: symbol `DE' redefined
zeroKey.asm:16: error: parser: instruction expected
zeroKey.asm:17: error: symbol `DE' redefined
zeroKey.asm:17: error: parser: instruction expected
zeroKey.asm:18: error: symbol `DE' redefined
zeroKey.asm:18: error: parser: instruction expected
zeroKey.asm:19: error: symbol `DE' redefined
zeroKey.asm:19: error: parser: instruction expected
zeroKey.asm:20: error: symbol `DE' redefined
zeroKey.asm:20: error: parser: instruction expected
zeroKey.asm:21: error: symbol `DE' redefined
zeroKey.asm:21: error: parser: instruction expected
zeroKey.asm:22: error: symbol `DE' redefined
zeroKey.asm:22: error: parser: instruction expected
zeroKey.asm:23: error: symbol `DE' redefined
zeroKey.asm:23: error: parser: instruction expected
zeroKey.asm:24: error: symbol `DE' redefined
zeroKey.asm:24: error: parser: instruction expected
zeroKey.asm:25: error: symbol `DE' redefined
zeroKey.asm:25: error: parser: instruction expected
zeroKey.asm:26: error: symbol `DE' redefined
zeroKey.asm:26: error: parser: instruction expected
zeroKey.asm:27: error: symbol `DE' redefined
zeroKey.asm:27: error: parser: instruction expected
zeroKey.asm:28: error: symbol `DE' redefined
zeroKey.asm:28: error: parser: instruction expected
zeroKey.asm:29: error: symbol `DE' redefined
zeroKey.asm:29: error: parser: instruction expected
zeroKey.asm:30: error: symbol `DE' redefined
zeroKey.asm:30: error: parser: instruction expected
zeroKey.asm:69: error: symbol `Org' redefined
zeroKey.asm:69: error: parser: instruction expected
zeroKey.asm:72: error: parser: instruction expected
zeroKey.asm:77: error: symbol `GOTO' redefined
...

有人可以解释我如何编译以及为什么会出错?

2 个答案:

答案 0 :(得分:0)

Read the documentation您要使用的工具。你使用错误的汇编程序。 NASM是一个x86汇编程序。它不了解PIC组装。

  

Netwide Assembler,NASM,是一个80x86和x86-64汇编程序

也许如果你解释你想用这个文件做什么,我们可以为你的问题提出更好的解决方案。

答案 1 :(得分:0)

您需要使用专为您的芯片设计的汇编程序(或编译器)。 This site似乎与用于组装和可能调试相关芯片的软件有关。通过一些谷歌工作,你应该能够找到你需要的其余部分。芯片本身似乎很容易使用。