How to represent hex value such as FFFFFFBB in x86 assembly programming?

Arcytoi picture Arcytoi · Jul 31, 2012 · Viewed 32.2k times · Source

I'm learning about x86 inline assembly programming.

I wanted to write mov ecx, FFFFFFBB, however the compiler isn’t recognizing it. How should hex numbers like that be written in inline assembler code?

Answer

Benoit picture Benoit · Jul 31, 2012

It depends on the flavour of your assembler.

  • AT&T: movl $0xFFFFFFBB, %ecx
  • Intel: mov ecx, 0FFFFFFBBh

FYI, AT&T syntax is used by assemblers such as the GNU Assembler, whereas NASM and most of others use Intel's one.