[comp.sys.atari.st] The Ultimate in Pexec?

neil@hwcs.UUCP (10/01/87)

Here is a teaser: Suppose I write a program that needs an immense amount
of ram (~850K). I compile/assemble & link the beast, but when I try to run it
I don't have enough memory due to the accessories & foldrxxx.prg. I could
load it at an absolute address and relocate it myself. Lets simplify things
a bit and say that it will be a .TOS program so I don't have to worry about GEM
and desk accessories. So far so good but here comes the snapper. If any of the
already resident programs have grabbed any interrupt/event driven code then
when I stamp over it KAPOWW! (as Batman used to say) and bombs all round.
So how can I restore the original vectors in an OS independant way?
I don't mind having to reboot after I have finished using the program all I
want is to run the thing.


-------------------------------------------------------------------------------
"I think all right thinking people in this country are sick and tired of being
told that ordinary decent people are fed up in this country with being sick and
tired. I'm certainly not and I'm sick and tired of being told that I am!"
- Monty Python

 Neil Forsyth                           JANET:  neil@uk.ac.hw.cs
 Dept. of Computer Science              ARPA:   neil@cs.hw.ac.uk
 Heriot-Watt University                 UUCP:   ..!ukc!cs.hw.ac.uk!neil
 Edinburgh
 Scotland
-------------------------------------------------------------------------------

bammi@mandrill.CWRU.Edu (Jwahar R. Bammi) (10/06/87)

In article <1461@brahma.cs.hw.ac.uk> neil@cs.hw.ac.uk (Neil Forsyth) writes:
>
>Here is a teaser: Suppose I write a program that needs an immense amount
>of ram (~850K). I compile/assemble & link the beast, but when I try to run it
>I don't have enough memory due to the accessories & foldrxxx.prg. I could
	If it is a TOS application just stick it in your AUTO\ folder,
copying it before foldrxxx.prg, and that way it will get all the memory
before GEM is even initialized or the ACCs are loaded.

>So how can I restore the original vectors in an OS independant way?
>I don't mind having to reboot after I have finished using the program all I
>want is to run the thing.

	You can inquire the present value of any vector or any psedi`o vector
 with a Setexc() xbios call (just pass it a negative arguement). Later you
can reset any vector using the same call. No need to reboot.
-- 
usenet: {decvax,cbosgd,sun}!mandrill!bammi	jwahar r. bammi
csnet:       bammi@mandrill.CWRU.edu
arpa:        bammi@mandrill.CWRU.edu
compuServe:  71515,155