Path: utzoo!attcan!uunet!snorkelwacker!ira.uka.de!fauern!fauern!csbrod From: csbrod@medusa.informatik.uni-erlangen.de (Claus Brod ) Newsgroups: comp.sys.atari.st Subject: Re: How can I find current DTA address w/o using TRAP #1? Message-ID: <3140@medusa.informatik.uni-erlangen.de> Date: 1 Oct 90 10:51:23 GMT References: <5429@bdt.UUCP> Organization: CSD, University of Erlangen, W-Germany Lines: 35 ADAM_TILGHMAN@bdt.UUCP writes: > I am in the middle of a project and have come upon an obstacle... I am >using an external PD program, but in order to get it to do what I want >I need to trap all FSFIRST/FSNEXT calls (in order to substitute my own >filenames), as well as FOPEN() calls (to change the filename to suit my >needs). So far I have this working perfectly EXCEPT for the fact that >I can't find the current DTA address; is there any way that I can >do this while processing a TRAP #1? Experience tells me that you can call a GEMDOS function in your own trap #1 handler _before_ executing the actual function desired by the user or OS. So build a trap handler, analyse what you get on the stack (beware of the difference between 68000 and 68010/20/30/40), then call Fgetdta (save those registers!), then call the desired function. Worked for me, but I don't know if this is a documented feature, so please don't blame me if it won't work. It just seems logical if you look at the way the GEMDOS trap handler works. Do you _really_ need to know things like that? Another method comes to my mind: If you're linked into the GEMDOS trap you can also follow any manipulation of the current DTA address by tracing Fsetdta calls (watch out for those Pexec calls that place the default DTA into the basepage). Sounds much cleaner to me, but then, this method assumes that DTA addresses are only changed by Fsetdta and Pexec calls and that GEMDOS doesn't change them internally. Good luck, CB ---------------------------------------------------------------------- Claus Brod, Am Felsenkeller 2, Things. Take. Time. D-8772 Marktheidenfeld, West Germany (Piet Hein) csbrod@medusa.informatik.uni-erlangen.de ----------------------------------------------------------------------