3

I have a code written in NASM syntax and is working well. I then used intel2gas to convert my NASM code into GAS. (used -i , the default which is intel to at&t format).

I never used GAS before, just pure NASM in all my assembly needs. I used intel2gas to learn the GAS code format. Now, I have some line in the converted GAS code which have warnings from intel2gas and was appended with a 'MISMATCH: ' prefix.

I have managed the others like in the .data and .bss sections, but I still have these:

MISMATCH: "lea ecx, [array + esi]"
MISMATCH: "lea ebx, [array + esi + 1]"
MISMATCH: "mov al, [array + esi]"
MISMATCH: "mov cl, [array + esi + 1]"

What's the equivalent GAS syntax of the NASM lines above?

Why did intel2gas did not completely convert my code and had left several MISMATCH lines?

Please help, thanks!


Using Ubuntu 13 x86

4

1 回答 1

3
lea ecx, [array + esi]
lea ebx, [array + esi + 1]
mov al, [array + esi]
mov cl, [array + esi + 1]

所有这些行都不使用与存储在寄存器中的地址的常量偏移量。从语法转换器的角度来看,标签地址是未知的,并且无法确定目标编译器使用什么配置。

翻译:

lea array(%esi), %ecx
lea array+1(%esi), %ebx
movb array(%esi), %al
movb array+1(%esi), %cl
于 2013-09-16T12:47:56.520 回答