assembly - .align directive proper usage with .align(5) and 0x90 -
i attempting learn assembly programming.i came across code.the macro entry used in asm file.but cannot understand code means?.
#define align(log) .align(log) ,0x90;
what 0x90 mean? quite new assembly.and why align(5) used instead of typical align(4) or align(8)
#if defined(__apple__) || defined(__freebsd__) || defined(__netbsd__) || defined(__openbsd__) # define align_log #endif #ifdef align_log # define align(log) .align (log), 0x90; #else # define align(log) .align 1 << (log), 0x90; #endif #define entry(name) \ align(5); \ .globl name; \ .globl _##name; \ name: ; \ _##name: ~
it's power-of-2 alignment, e.g., align(4)
16-byte alignment, align(5)
32-byte, etc. 0x90
specifies opcode nop
instruction - used padding instructions achieve alignment.
there longer instructions sequences effective nops
. many of assemblers support more flexible .p2align
directive; recent gnu-based assemblers example.
Comments
Post a Comment