inline intel syntax to inline gcc

246 Views Asked by At

I'm trying to convert a snippet of mine to a compiler that uses an inline asm syntax similar to gcc's. I read the documentation and all was fine until I encountered this line:

mov eax, dword ptr fs:[0x20]

I converted that to:

movl 0x20(%fs:), %eax

The compiled flipped, telling me that fs is not a 32bit register and that this operation is invalid. How should I access fs in at&t syntax?

1

There are 1 best solutions below

0
On

Found the answer, it seems that gcc or the at&t is very inconsistent.

movl %fs:0x20, %eax