align

Problems which concern EuroAssembler
fuzzball
Posts: 1
Joined: 07 Sep 2020 12:09

align

Unread postby fuzzball » 07 Sep 2020 12:25

test.asm wrote: |0000:C3 | ret
|0001:9087C9 | align 4 ;Why "9087C9" instead of "909090"?
User avatar
vitsoft
Site Admin
Posts: 41
Joined: 04 Nov 2017 20:08
Location: Vítkov, The Czech Republic
Contact:

Re: align

Unread postby vitsoft » 08 Oct 2020 19:15

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.

Who is online

Users browsing this forum: No registered users and 1 guest