Jump to content
IGNORED

EXE file segments


Recommended Posts

Jesus...

 

I am used to INIT/RUN since for more than 20 years and first I thought this is common on every plattform until I did some C64/VIC stuff... and I was thrown back to 70s ;).

 

in Superpacker (as you need to crunch your data anyway at the end)... you can set/delete/pack each segments separatly. There is Windows tool available.

 

I used this memory overlay concept with segemts for some demos which run on 64k machines but have additional FX on >64kb machines...

 

so I did a

 

memtest segment

INIT memtest, store the amount of RAM banks available

load effect1 at $4000...

INIT set_next_bank

load effect2 at $4000...

INIT set_next_bank

load effect3 at $4000...

load main part

RUN main

  • Like 2
Link to comment
Share on other sites

  • 1 month later...

Are segments ordered at all or they just loaded in the order they occur in the source file?

 

For instance:

ORG $3000

<some instructions>

ORG $600

<some instructions>

ORG $2E0

WORD $3000

Would the specified code be loaded into address $3000 onwards first, then code be loaded in $600 onwards and then finally a WORD value at $2E0. OR would they be loaded in numerical order, ignoring the order the segments occur in the source?

Edited by morelenmir
Link to comment
Share on other sites

Correct, but beware that there are compilers which sort the segments by address before they write them to the file, like e.g. ATASM. There have to use special options to keep the order defined in the source. MADS always uses source code order.

Edited by JAC!
  • Like 2
Link to comment
Share on other sites

Almost off topic considering modern tools and techniques.

 

You can just use a disk with a MEMSAV and DOS. MEMSAV is useful for going to DOS w/o losing your BASIC or ED/ASM source, but it also works with any binary you may have in memory. It can be pretty useful in a lot of different circumstances. For instance, some one has a page 6 VBI music program you want to use in your program but don't have the source. Just use binary save w/o RUN or INIT vectors and then use COPY with the append /A option to prepend it to your program.

Edited by ricortes
  • Like 1
Link to comment
Share on other sites

The AtAsm trait of putting the file in memory order is very annoying.

 

But using .bank directive between every origin change forces it to create your object file in the intended way.

 

MEM.SAV is superceded in some cases these days by the better Doses which do save/restore of the low main Ram area to extended Ram either under the OS or PortB banked.

However with IDE class devices it's often better/faster to use the file based MemSav as it's usually quicker for the Dos to do the save/restore operation and has the additional benefit that some even allow saving work area across powerdowns.

Link to comment
Share on other sites

  • 5 years later...

You can also append segments to do certain functions such as FF FF C6 02 C6 02 00 to make the screen background black, IIRC. In that case, the FF FF is optional. It could be C6 02 C6 02 00.

 

It's late, and that's from the 'top of my head', but it sounds right.

 

Edit: Typo.

Edited by Kyle22
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...