They don't need to know about each other, so I made
a menu program that runs the others using HomeExecute,
passing just one parameter..
sprintf(cmdstring, "%s(%u)", progname, menu_request);
len_of_cmd = strlen(cmdstring);
ClrScr();
HomeExecute(cmdstring, len_of_cmd);
TestLabel02:
ClrScr();
This works fine, for a while. Sooner or later, sooner if the
called programs are large, it crashes with an illegal instruction
error on returning from the slave program.
I put in debugging code to give me the address of TestLabel02
before the HomeExecute happens, and the invalid instruction is
always 4 bytes after TestLabel02.
It looks to me like garbage collection is moving the master
program while the slave is active, and the O/S doesn't handle the
return address of the call. Or maybe the master isn't there at all
anymore.
Since HomeExecute does indeed return execution to wherever
it was called from, I had hoped this wouldn't happen, and it doesn't,
with trivial examples. But try something like a 12k master and a bunch
of 32k slaves, and it crashes right away.
Can somebody tell me how to lock the memory around the master
program while execution is in the slave? I can't find it now, but I
read somewhere that a running C/ASM program is automatically
locked, but apparently the lock on the master gets released by
whatever happens in HomeExecute on the way to the slave.
If I'm totally out to lunch on this, I'd like to hear any opinions on
what's going on.
If I archive the programs, it takes a little longer for this to happen,
but it still does. I don't think it's uninitialized variables or something
like that.
I'm using the IDE, set for no kernel. I've tried turning
off all optimization in the compiler and linker, and it didn't
make any difference.
I'm testing on TI-Emu: TI 89 Titanium, Model TI89t
O/S v 3.10 Hardware v 3.00
Thanks for any help.

