Question

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

Was it helpful?

Solution

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

All these lines don't use constant offset from address stored in register. From the view of syntax translator, label addresses aren't known and it can't be sure what configuration does target compiler use.

Translation:

lea array(%esi), %ecx
lea array+1(%esi), %ebx
movb array(%esi), %al
movb array+1(%esi), %cl
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top