我终于回到了我的colorforth项目,几年前我放弃了对binutils的更新打破了我的所有来源。这是一个正在发生的事情的例子:
jcomeau@aspire:~$ cat /tmp/test.as
.intel_syntax
.arch i386
.code32
mov eax,[foo + eax*4]
lea ecx,[ecx*4+0x9e0]
mov edx,DWORD PTR [edi*4-0x4]
jmp DWORD PTR [ecx*4+0x12cc]
lea edx,[ecx+edx*1]
第一个非指令行来自手册中的示例:https://sourceware.org/binutils/docs/as/i386_002dMemory.html#i386_002dMemory,其余来自使用--disassembler-options=intel
的objdump反汇编。每一个都没有组装:
jcomeau@aspire:~$ as /tmp/test.as
/tmp/test.as: Assembler messages:
/tmp/test.as:4: Error: too many memory references for `mov'
/tmp/test.as:5: Error: too many memory references for `lea'
/tmp/test.as:6: Error: too many memory references for `mov'
/tmp/test.as:8: Error: too many memory references for `lea'
/tmp/test.as:7: Error: invalid operands (*UND* and *ABS* sections) for `*'
我一整天都在谷歌上搜索,没有运气。我确定我做错了什么,但是如果我能弄明白它是什么,该死的。我apt-get source binutils
,但不知道从哪里开始寻找。
jcomeau@aspire:~$ as --version
GNU assembler (GNU Binutils for Debian) 2.25.90.20151209
Copyright (C) 2015 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `i686-linux-gnu'.
那么再次使用gas
烹饪的神奇咒语是什么?
答案 0 :(得分:4)
将GNU汇编程序与.intel_syntax
指令一起使用时,您需要使用noprefix
选项强制 AS 不需要%
(百分号) )预先注册名称(如AT& T语法)。您应该使用:
.intel_syntax noprefix