EASy68K
http://www.easy68k.com/EASy68Kforum/

Force allignment
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=3&t=1573
Page 1 of 1

Author:  profkelly [ Tue Dec 27, 2016 9:20 am ]
Post subject:  Force allignment

Add directive to force Long address alignment.

Author:  vinz67 [ Sat Feb 22, 2020 4:56 pm ]
Post subject:  Re: Force allignment

According to documentation, you can use

Code:
    DS.W 0 ; forces word alignment.


See documentation of the DS and DC directives.

Yes,some assemblers sometimes provide an EVEN directive which does just that, i.e force the next command to be on a word-aligned address.

This directive doesn't exist in EASy68k (it could be added indeed) but you can have a very similar thing by making a macro:

Code:
EVEN   MACRO
   DS.W 0
   ENDM

Author:  profkelly [ Sat Feb 22, 2020 11:45 pm ]
Post subject:  Re: Force allignment

Force Long alignment was a user request. DS.W 0 or DS.L 0 forces word alignment but not Long alignment.

Author:  MortenZdk [ Fri Apr 10, 2020 2:45 pm ]
Post subject:  Re: Force allignment

Long alignment can be done with:
Code:
ORG (*+3)/4*4

and arbitrary alignment can be defined with a macro, along same principles, like:
Code:
ALIGN   MACRO
            ORG (*+((1<<\1)-1))/(1<<\1)*(1<<\1)
        ENDM

        ALIGN 1  * Word alignment
        ALIGN 2  * Long alignment
        ALIGN 8  * 256 byte block alignment

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/