EASy68K  
It is currently Sun Dec 17, 2017 3:52 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: ALIGN command
PostPosted: Sat Nov 28, 2009 9:04 pm 
Offline

Joined: Sun Nov 01, 2009 4:02 pm
Posts: 12
Location: Belgium
Hello,
I it possible to add the 'ALIGN' command in the easy68k assembler/editor ?
Is it also possible to add selection for W and L ?

Thanks,
Marc

_________________
Greetings from Belgium
Hobby robot builder
www.marc-systems.be


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 29, 2009 4:00 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1056
A suggested syntax. Comments?


Syntax: align alignment[, [fill][, max]]

Pad the location counter (in the current subsection) to a particular storage boundary. alignment (which must be absolute) is the alignment required, as described below.

fill (also absolute) gives the fill value to be stored in the padding bytes. It (and the comma) may be omitted. If it is omitted, the padding bytes are zero.

max is also absolute, and is also optional. If it is present, it is the maximum number of bytes that should be skipped by this alignment directive. If doing the alignment would require skipping more bytes than the specified maximum, then the alignment is not done at all. You can omit the fill value (the second argument) entirely by simply using two commas after the required alignment.

Examples:
Code:
        align  2        force word align
        align  4        force long word align
        align  2048, $4E71, 1024  force alignment on 2K boundary, fill with NOP instructions, don't align if more than 1024 bytes required.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 29, 2009 3:36 pm 
Offline

Joined: Sun Nov 01, 2009 4:02 pm
Posts: 12
Location: Belgium
Hello,

This is very nice.
It is even more than I dreamed of.

For me, I can save a lot of time with this extra command.

align 2 force word align
align 4 force long word align

Is it also possible to add the syntax 'ALIGN',
for always aligning on long addresses.


Thanks very much.
Best regards,
Marc

_________________
Greetings from Belgium
Hobby robot builder
www.marc-systems.be


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 29, 2009 4:22 pm 
Offline

Joined: Mon Jun 20, 2005 4:55 pm
Posts: 14
Can this be done with a macro?

Code:
00001002        12  ALIGN   MACRO
00001002        13          DS.B    (*+\1-1)&-\1-*
00001002        14          ENDM
00001002        15 
00001002        16          DS.W    0       ;align to word
00001002        17          DS.B    1       ;force odd address
00001003        18         
00001003        19m         ALIGN   4
00001003        20m         DS.B    (*+4-1)&-4-*
00001004        21m         ENDM
00001004        22         
00001004        23          DS.B    1
00001005        24         
00001005        25m         ALIGN   2
00001005        26m         DS.B    (*+2-1)&-2-*
00001006        27m         ENDM


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 29, 2009 5:20 pm 
Offline

Joined: Mon Jun 20, 2005 4:55 pm
Posts: 14
Here are some other (better) macros.

If Marc just wants to type ALIGN and have it always align to long, then this macro will fullfill his needs.

Code:
ALIGN   MACRO
        DS.B    (*+3)&-4-*
        ENDM


(I would prefer to call this macro LONG, but he is trying to make his code compatible with a different assembler.)

This ALIGN macro needs an argument but it will align to any number, including odd numbers (like 5 or 13).

Code:
ALIGN   MACRO
        DS.B    (*-1)/\1*\1+\1-*
        ENDM


This ALIGN will work with any argument but it will align to long if there is no argument. The listing is a little uglier.

Code:
ALIGN   MACRO
        IFARG   1
        DS.B    (*-1)/\1*\1+\1-*
        MEXIT
        ENDC
        DS.B    (*+3)&-4-*
        ENDM


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 01, 2009 7:34 am 
Offline

Joined: Sun Nov 01, 2009 4:02 pm
Posts: 12
Location: Belgium
Hi paulrsm,

Yes, the reason I like to use ALIGN are two older 'DOS' working assemblers.
One of them 'PseudoAsm' uses '.ALIGN' and the other just 'ALIGN'.

The .ASM software for my robot takes about 1.5 Mb as an assembler file.
So a lot of work to change it for the EASY68K software.

I'm also rewriting an older assembler who works on my 68K SBC.
So I do not have to use the PC anymore.

And there they also use the 'ALIGN' command.


Thanks for the input,
greetings,
Marc

_________________
Greetings from Belgium
Hobby robot builder
www.marc-systems.be


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 01, 2009 10:12 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1056
Using a macro is a viable solution that does not require any modification of the EASy68K code , which is less work for me :). I will consider this wish granted.

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group