Page 1 of 1
align
Posted: 07 Sep 2020 12:25
by fuzzball
test.asm wrote:
|0000:C3 | ret
|0001:9087C9 | align 4 ;Why "9087C9" instead of "909090"?
Re: align
Posted: 08 Oct 2020 19:15
by vitsoft
Since version 20180928 EuroAssembler uses HINT_NOP for alignment in code section when CPU level is 686 or X64.
This instruction is not available on older processors, €ASM emits combination of legacy
do-nothing-instructions in this case, such as
XCHG reg,reg or
LEA reg,[reg].
For instance, when we need seven bytes of alignment in 32bit mode, €ASM emits a single instruction 8D842000000000 (disassembled as
LEA EAX,[EAX+0*EAX+0]), which is performed faster than having to fetch and execute 90 (NOP) seven times.
For information what code is used as alignment stuff see the table
No-operation encoding in the manual.