-1

我正在寻找使用 Ubuntu 12.04 和 NASM 在上网本上编译 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
...

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

4

2 回答 2

0

您需要使用专为您的芯片设计的汇编器(或编译器)。 该站点似乎有用于组装和可能调试相关芯片的软件的链接。通过一点谷歌工作,您应该能够找到所需的其余内容。芯片本身似乎很容易使用。

于 2013-07-17T15:28:50.173 回答
0

阅读您要使用的工具的文档。您使用了错误的汇编程序。NASM 是一个 x86 汇编器。它不理解 PIC 程序集。

Netwide 汇编器 NASM 是一个 80x86 和 x86-64 汇编器

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

于 2013-07-17T14:53:42.953 回答