Jump to content
IGNORED

Safe to use $3FD - $4FF area when loading file


Recommended Posts

I've got a decompressor routine that I use in my code and located it at $2000. Now I want to pack my xex file blocks and was wondering if I can move the decompressor to the tape buffer area @ $3FD - $4FF?  Is it safe for all DOS versions?

 

If not seen many programs use that space, so having a decompressor located there would be great. Extra benefit is that the code is exactly $103 bytes.  Maybe even a general packer could be written.

Link to comment
Share on other sites

The cassette buffer will not be used by normal Atari DOSes  (DOS 2 family), as they do not want to interfere with the "C:" device.
I wouldn't be so sure for SpartaDOS like systems and also for those tiny "DOSes" that do not do anything else than load one binary file (MicroDOS, PicoDOS, PicoBoot).

There is never a guarantee. You would need to consult docs of the respective DOSes.

 

I believe a better option would be to decide with what DOSes you want your program to work with. And then choose the location for the depacker accordingly.

It is no shame to support only subset of DOSes on this platform.

 

 

 

 

  • Like 3
Link to comment
Share on other sites

If this area is used only as temporary, then likely ok, though there is of course a hand full of software whose authors had the same idea. (-: For example, DDT (the Mac/65 debugger) uses this area for its temporaries. The most reliable and portable way would be to allocate space directly above MEMLO and relocate your code into this area. That's the "official" way.

 

  • Like 1
Link to comment
Share on other sites

Currently my packer asks for a location of a safe space and then locates the de-packer and the compressed data there. Once a piece is compressed into the right location the next file block is loaded into the safe space etc.  Works quite well if you know your program does not use a specific memory area.

 

Not writing a general purpose packer, but hoping to have one flexible enough for various programs.

 

The other advantage I have is that my level data is compressed and the same de-packer is already used in the game, so loading it at its final location as the first block in a file and then using it to unpack the rest of the program is a bonus :)

Link to comment
Share on other sites

The cassette buffer only extends to $047F. $0480-$06FF is considered user program memory (Atari OS Manual, section 4), with the caveat that the floating-point package can use part of it if used by the program. Thus, if you're concerned about conflicts with C:, only half of this memory is affected.

 

 

  • Like 1
Link to comment
Share on other sites

Think if you are packing a ML program and it does not use/require Basic, then you can use pages 4, 5 and 6 safely. I am using pages 4 and 5 for Superpacker/Exomizer buffer and depacker since several years now without any problems. The only time when I cannot use that area is when the (unpacked) ML program itself makes use of these memory pages.

 

  • Like 1
Link to comment
Share on other sites

Oh no, not again. Look, have you now understood how a binary load file works? This area is likely too small for compiled programs, and it is not generally safe to use, in particular to programs that using parts of the Os services. These are tape and printer buffers, and conversion buffers for the math pack functions.

 

In general, 0x1f00 and up is a good place for user programs, and not this area.

 

  • Like 3
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...