gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

ASM > thumb & align question !

#85718 - wickedtrickster - Thu Jun 01, 2006 11:47 pm

Hello,

I'm currently learning ARM & thumb assembly. I'm starting to understand how both works but there is a little thing which is bugging me.

Many example code I see in thumb have the .align 4 directive at the start of the file, but from what I understand, isn't it suppose to be .align 2 ? Is there an advantage for using .align 4 ?

Thank you,
Ben.

#86040 - ProblemBaby - Sun Jun 04, 2006 12:51 am

If I remember correct ".align x" alignes the data to a (1 << x) boundary. So its a no idea to have 4 instead of 2. If rember wrong though its important to have 4 to not make data misaligned.