Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Best place to hide about 30 bytes in //e RAM

28 views
Skip to first unread message

Egan Ford

unread,
Mar 3, 2012, 10:41:01 AM3/3/12
to
Programmers,

I just created a program launcher that I'd like re-activate on
CTRL-RESET. I know that I have no control over the programs being
launched and that there will be a chance that my reset vector bytes
($3F2-$3F4) may get hosed, but in the event they do not, where is the
least likely place someone will use memory? I tried page $BF with the
worse results. Right now I am starting at $310 with good results, but
I'd like better results if possible.

Thanks.

P.S., I should mention that this is for the //e only. The main program
is in AUX memory, my reset routine on CTRL-RESET copies back to main
memory. I cannot run from AUX memory since I use self-mod code and need
a fresh instance on restart.

Thanks again.

Steven Hirsch

unread,
Mar 3, 2012, 2:10:13 PM3/3/12
to
On 03/03/2012 10:41 AM, Egan Ford wrote:
> Programmers,
>
> I just created a program launcher that I'd like re-activate on CTRL-RESET. I
> know that I have no control over the programs being launched and that there
> will be a chance that my reset vector bytes ($3F2-$3F4) may get hosed, but in
> the event they do not, where is the least likely place someone will use
> memory? I tried page $BF with the worse results. Right now I am starting at
> $310 with good results, but I'd like better results if possible.

How about the beginning of the stack page? IIRC, few (if any) programs get
that close to the end. I hacked up a modified version of the RamFast ROM that
copied a small software loop into that location to speed things up when
running with ZipChip or TransWarp 2e accelerators (where DMA is a
non-starter). Never saw a problem with stack collisions.

Antoine Vignau

unread,
Mar 3, 2012, 3:53:24 PM3/3/12
to
Is the launcher ProDOS or DOS 3.3 based?

If it is ProDOS, use either the beginning of page 1, the first 128
bytes of pages 2 or 3.
If it is DOS 3.3 based, use the RWTS buffers from $BB00 to $BC55
unless your launcher reads sectors from disk.

In both cases, you have free room in the text screen area...

Antoine

ict@ccess

unread,
Mar 3, 2012, 9:47:25 PM3/3/12
to
Since you mentioned $BF, I gather you are using Prodos. Are you using
Basic.system?
Do you still need your reset program to be safe in memory when you run
system programs?

So why not install your 30 bytes between Prodos and its buffers.

LDA #1
JSR $BEF5

The accumulator is returned with the high byte of the address where
free memory has opened up.

I have a whole page of different subroutines that I install there when
I run basic.system, so very little memory is wasted. Anything from
keyboard shortcuts to a short program to allow the <delete> key to
work ... etc etc

OR

put your program launcher in place of the BYE routine in Prodos. This
way any system, binary or applesoft program has access to it, since
Prodos is always in memory.


Rob

Egan Ford

unread,
Mar 4, 2012, 1:33:40 PM3/4/12
to
Sorry guys, I should have provided a bit more information. Here is a
video of my project:
http://asciiexpress.net/gameserver/gameserverclient.mp4. It does not
use DOS or ProDOS, but directly loads from disk using this tool:
http://asciiexpress.net/files/c2d-0.1.zip. Once loaded into memory and
copied to AUX memory the diskette is only used if it is necessary to
reload the program launcher from disk. The actual program selected gets
launched from the cassette port input.

Steven,

Yes, great idea and I tried, but too many of the games hosed the entire
stack.

Antoine,

I started with page 3, and was mostly successful, but after reading your
post, I switched to page 2 ($2D0)--even better, thanks!

Rob,

Thanks for the tips, but not using ProDOS. I wanted to load the client
as quickly as possible and opted to use directly load from diskette.

Hugh Hood

unread,
Mar 4, 2012, 6:55:42 PM3/4/12
to
Steven,

I don't mean to step on Eagan's thread, but your idea of stealing a few
bytes from the beginning of the stack page is super nifty.

Frankly, I never considered it, until now. Thanks.

I wonder how far into that stack page a guy could go before he ran into
trouble? I guess it 'depends'. Hmmmm.

BTW, your tease about the RamFAST ROM mod just screams for more detail.

Apologies, Eagan.




Hugh Hood







in article VJSdnWiZfuoI8c_S...@giganews.com, Steven Hirsch at
snhi...@gmail.com wrote on 3/3/12 1:10 PM:

Hugh Hood

unread,
Mar 4, 2012, 6:57:34 PM3/4/12
to
in article CB795D1E.8B4B%hugh...@earthlink.net, Hugh Hood at
hugh...@earthlink.net wrote on 3/4/12 5:55 PM:

> Steven,
>
> I don't mean to step on Eagan's thread, but your idea of stealing a few
> bytes from the beginning of the stack page is super nifty.
>
> Frankly, I never considered it, until now. Thanks.
>
> I wonder how far into that stack page a guy could go before he ran into
> trouble? I guess it 'depends'. Hmmmm.
>
> BTW, your tease about the RamFAST ROM mod just screams for more detail.
>
> Apologies, Eagan.
>
>
>
>
Egan,

Apologizes again. I _will_ learn how correctly to spell your name.

Hugh...


ict@ccess

unread,
Mar 4, 2012, 10:19:52 PM3/4/12
to

>
> Thanks for the tips, but not using ProDOS.  I wanted to load the client
> as quickly as possible and opted to use directly load from diskette.

2nd try

If you are not using Dos or Prodos, that should mean then that the
area usually reserved for those OSes are available.

Such as $3D0 to $3EF. $3F0-$3FF still can use interrupts, the reset
handler, the ampersand and ctrl-Y handler.

But there is 32 bytes that should never be trounced on due to it
normally being reserved by one of the OSes.

Rob

Egan Ford

unread,
Mar 5, 2012, 10:55:13 AM3/5/12
to
No worries. No offense taken.

Egan Ford

unread,
Mar 5, 2012, 10:56:02 AM3/5/12
to
I'll give $3D0 a shot. Thanks.

Antoine Vignau

unread,
Mar 5, 2012, 5:25:04 PM3/5/12
to
FYI, within ProDOS, $280..$2FF is reserved for the prefix buffer.
antoine
0 new messages