[A83] Re: Executing programs from and other programs...


[Prev][Next][Index][Thread]

[A83] Re: Executing programs from and other programs...




> Your initial program should do what it has to do, then 
when you want to run
> another asm program, find the program in ram using 
ChkFindSym and copy it to
> usermem... careful of the 2 byte header though... then 
call 9d95h (usermem).
> Note that you should keep all your variables at the end 
of your initial
> program so they don't get overwritten. Also, the code 
that copies the
> program should be far along enough in your initial 
program so that it does
> not get overwritten with the copy. When the call usermem 
returns, find the
> original program and copy that back to usermem (not all 
of it though.. keep
> your vars in tact).

Currently I'm actually swapping memory areas intead of 
copying. The advantage is that you don't even need a single 
byte of free memory after having the loader executed to 
perform the operation. The drawback is of course that the 
VAT won't match the contents of the memory for the running 
time of the program called this way. However, since using 
your method the memory is already reserved, you don't have 
to worry about this. This also means that you don't need to 
search for the original program, just swap the same memory 
areas again and continue where you left off.

PG









References: