We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I don't want to setup the vector table for all my external interrupts. For instance I only need the timer4 IRQhandler at IRQn 30. How can I make an offset in the table? Is this necessary?
yasuhikokoumoto Hi, can you explain me the .align 7. I know .align 4 align to a word boundary.
The .align directive is a bit 'unnatural' and very confusing.
in fact, it is based upon the power of two, and it's one directive, which I would like to change the rules for, if I could.
But it is what it is, and it's too late to change it, because it's been like this for more than 15 years already.
To give you a visual overview:
.align /* aligns to the default alignment for your architecture */
.align 1 /* aligns to the next 16-bit boundary (halfword, 2-byte) */
.align 2 /* aligns to the next 32-bit boundary (word, 4-byte) */
.align 3 /* aligns to the next 64-bit boundary (double-word, 8-byte) */
.align 4 /* aligns to the next 128-bit boundary (quad-word, 16-byte) */
.align 5 /* aligns to the next 256-bit boundary (octa-word, 32-byte) */
.align 6 /* aligns to the next 512-bit boundary (hexa-word, 64-byte) */
.align 7 /* aligns to the next 1024-bit boundary (well, eh, 128-byte) */
... and so on.
You can calculate the alignment by (1 << n) ... or if your calculator can handle it: 2 ^ n.
Hi jvanmont,
there are two ways to specify the 'align parameter'. One is to specify a direct byte boundary and another is to specify a boundary by the power of two. GCC (GNU-assembler) adopts the latter way. Regarding ALIGN 7, please refer to the jensbauer's explanations.
Best regards,Yasuhiko Koumoto.