I want to achieve a similar effect as assemblying a program with nasm -f elf64
that uses BITS 32 directive.
Such a code:
BITS 64mov eax, 0xamov edx, 0xfimul eax, edxret
assembled with this command looks like this:
b8 0a 00 00 00 ba 0f 00 00 00 0f af c2 c3
Such a code:
BITS 32mov eax, 0xamov edx, 0xfimul eax, edxret
assembled with this command looks like this:
66 b8 0a 00 00 00 66 ba 0f 00 00 00 66 0f af c2 c3
I want to achieve similar effect in C. Preferably with GCC compiler, but it can also be LLVM or any other.