문제

How does it works exactly? does the last align override the behavior of the previously one making its effect null or does it do something when used together? I found this from a large assembly source code and I'm asking this because I don't think it's just a typo.

align 64
align 4
도움이 되었습니까?

해결책

align inserts NOPs to bring the current section offset to a multiple of the specified value. (You can also explicitly specify a value other than NOP to insert, such as NULL padding). It does also implicitly call SECTALIGN to set the section's alignment attribute.

See NASM manual section 4.12.12.

So it's a typo -- the second align will do nothing since the first one already padded up to 64-byte alignment. And the implicit SECTALIGN also has no effect since the manual specifies the alignment attribute can only be increased, never decreased.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top