Jump to content
Jagware
Sign in to follow this  
swapd0

Aln File Format

Recommended Posts

swapd0    0

Hi, I've been looking at ALN fileformat and have some questions.

 

Imagine that you that you've this code.

    .org $4000
    lea foo,a0
    lea bar,a1
    rts
foo .dc.w 0
bar .dc.w 1

If you generate a binary output, you'll have something like this

    .org $4000
    lea $4000+14,a0       // 6 bytes
    lea $4000+16,a1       // 6 bytes
    rts                   // 2 bytes
foo .dc.w 0
bar .dc.w 1

But on ALN file format, are the offsets $0 relative for object files?

 

Second question, data and bss sections must be moved to the end of each object file? If you are linking some files data and bss sections must be moved at the end of the output? I think that Genst works like this.

 

If this is true, then this code is wrong. Isn't it?

    .extern foo
    move.w foo(a0),d0    // illegal because offset can be .l

    .text
    move.w bar(a0),d0    // illegal because bar will be moved, and offset can be bigger than .w
    ...
    .data
bar .dc.w 0

 

Thanks.

Share this post


Link to post
Share on other sites
SebRmv    2
Second question, data and bss sections must be moved to the end of each object file? If you are linking some files data and bss sections must be moved at the end of the output? I think that Genst works like this.

 

I believe the answer is yes.

 

I believe that ALN object file format is nothing more than BSD a.out file format.

A good starting point to get documentation is certainly Wikipedia.

 

Cheers

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×