flat assembler
Message board for the users of flat assembler.

flat assembler > Main > section alignment / func alignment (x86-64 windows)

Author
Thread Post new topic Reply to topic
gravvityy



Joined: 17 Oct 2019
Posts: 1
is there a way to set section alignment and make sure every function / proc aligns on an address that is a multiple of 16 or must i type "align 16" between each function? is there an easy way to do this (with a macro perhaps?)

Code:
section '.text' code readable writeable executable
    


edit: and i just realized i posted this in the wrong section, move if possible please Smile
Post 17 Oct 2019, 23:41
View user's profile Send private message Reply with quote
donn



Joined: 05 Mar 2010
Posts: 138
I use:

Code:
section '.text' code readable writeable executable align 16    


Code:
section '.data' data readable writeable align 16    


And keep the stack aligned separately.

Code:
        and rsp, -32    


Also, I ensure the stack pointer increments and decrements are paired:

Code:
sub rsp, 8*8
...
add rsp, 8*8    


mostly just from trial and error, furs mentioned the and rsp, -32 technique, I believe.
Post 18 Oct 2019, 13:18
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.