Jump to content

Recommended Posts

Hello,

 

I am reorganizing my source code of an assembly program that will be loaded from XB with CALL LOAD.

 

Before, there was only one relocatable section without any special directive, and when laoded I got FFADDR and LFADDR correctly pointing to the end of my routines and to the start of the REF/DEF table.

 

Now I want to have this:

 

1 section with relocatable code loaded in low memory

 

1 section with absolute code (tables and other data) loaded at >A000

 

So i wrote this:

 

first section...

AORG >A000

second section

END

 

Everything is correctly loaded where I want to, but FFADDR doesnt point to the end of my first relocatable section as I wanted... It remains at its original value of >24F4.

 

How should I use AORG or other directives?

I wouldn't like to separate my source into two blocs.

 

Guillaume.

Link to comment
https://forums.atariage.com/topic/200845-assembly-aorg-rorg-help-wanted/
Share on other sites

If you have to bodge it, as it looks as if the loader isn't updating the value of FFADDR, how about adding ...

 

RLABEL EQU $

 

... at the end of your relocatable section, then after the second section, add ...

 

AORG (address at which FFADR is stored)

DATA RLABEL

 

Might work?

 

Stuart

Guillaume...

 

Do you get FFADDR by PEEKing >8308? It is not clear to me exactly how XB handles assembly object code regarding free addresses, so, perhaps, I should not muddy the waters here---I will anyway :D . There appear to be only one "first free address" and one "last free address" that both start out pointing to low memory expansion. The E/A cartridge has two each, viz., one set for low and one for high memory expansion. It would be interesting to load your program with E/A option 3 and check >2024, >2026, >2028, >202A, which are FSTHI, LSTHI, FSTLO, LSTLO, respectively, in the utility table (UTLTAB) that the E/A loader updates.

 

...lee

If you have to bodge it, as it looks as if the loader isn't updating the value of FFADDR, how about adding ...

 

RLABEL EQU $

 

... at the end of your relocatable section, then after the second section, add ...

 

AORG (address at which FFADR is stored)

DATA RLABEL

 

Might work?

 

Stuart

 

Hehe ! I had the same idea, and it works... during one second !!

You can see location >2004 turning to the correct value, but then, at the end of the loading, the >24F4 re-appears when the laoder has finished its work.

 

It's really a problem with the loader that really sets FFADDR to >24F4 because the "AORG" directive seems to tell it that there is no relocatable code and that no use to change the pointers...

 

Guillaume.

I've got the solution!

The idea was to put the relocatable part at the end, and the loader stays in this mode at the end and manages correctly the pointers:

 

AORG >A000
.. here my data ...

RORG 0
... here my code ...
END

 

Everything works well now,

 

Guillaume.

I've got the solution!

The idea was to put the relocatable part at the end, and the loader stays in this mode at the end and manages correctly the pointers:

 

AORG >A000
.. here my data ...

RORG 0
... here my code ...
END

 

Everything works well now,

 

Guillaume.

 

Cool! But, it would be nice to figure out what XB is doing in your first example.

 

...lee

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...