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?
Found the answer, it seems that gcc or the at&t is very inconsistent.