Jump to content
IGNORED

MADS alignment issue


Recommended Posts

 

I'm using the .align directive which works fine usually but not in this particular case:

 

As you can see the directive is at A28C and the string "does not align" should be at A300 like it says in the generated listing file.

 

However looking at it in the debugger, that's not the case: the directive just gets ignored.

 

I've even tried ORG which doesn't work either (works fine too usually)

 

using 2.0.8 b31 (switches in the pic)

madsalign.png

Link to comment
Share on other sites

Normally, a change in ORG would cause the assembler to end the current segment and start a new one so the loader changes to a new address. You have DOS headers turned off (OPT H-), though, so it can't do this and just writes the segments back-to-back. If you want the assembler to insert bytes to fill the difference in addresses, you need to enable fill (OPT F+).

 

Link to comment
Share on other sites

1 hour ago, phaeron said:

Normally, a change in ORG would cause the assembler to end the current segment and start a new one so the loader changes to a new address. You have DOS headers turned off (OPT H-), though, so it can't do this and just writes the segments back-to-back. If you want the assembler to insert bytes to fill the difference in addresses, you need to enable fill (OPT F+).

 

 

Ah Thanks, I actually did .align $100,$ff and that did the same thing. OPT F+ is the better solution because I'm sure I've got a few other .align scattered.

 

(the listing is still inaccurate though)

Edited by rensoup
Link to comment
Share on other sites

Just checked some listings and looks like you'd use the address, not that you would like to align to the next page, e.g.
 

    opt h -
NO_QUOTE = 1
    
    org $4000
    icl 'charset40.s'
    icl 'mem4400.s'
    icl 'GameOver.s'

    .align $5000,0
    icl 'charset50.s'
    icl 'logos.s'

A alternative way to align to a page:

:(((*+$FF)&$FF00)-*)    dta 0

 

Edited by Wrathchild
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji 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.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...