Jump to content

Aln File Format


swapd0

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...