While going through some C code having inline assembly I came across the .byte (with a Dot at the beginning) directive.
On checking the assembly reference on web I f
Here's an example with inline assembly:
#include
void main() {
int dst;
// .byte 0xb8 0x01 0x00 0x00 0x00 = mov $1, %%eax
asm (".byte 0xb8, 0x01, 0x00, 0x00, 0x00\n\t"
"mov %%eax, %0"
: "=r" (dst)
: : "eax" // tell the compiler we clobber eax
);
printf ("dst value : %d\n", dst);
return;
}
(See compiler asm output and also disassembly of the final binary on the Godbolt compiler explorer.)
You can replace .byte 0xb8, 0x01, 0x00, 0x00, 0x00 with mov $1, %%eax
the run result will be the same. This indicated that it can be a byte which can represent some instruction eg- move or others.