Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!julius.cs.uiuc.edu!apple!portal!atari!apratt From: apratt@atari.UUCP (Allan Pratt) Newsgroups: comp.sys.atari.st Subject: Re: How can I find current DTA address w/o using TRAP #1? Message-ID: <2318@atari.UUCP> Date: 1 Oct 90 18:15:29 GMT References: <5429@bdt.UUCP> Organization: Atari Corp., Sunnyvale CA Lines: 30 ADAM_TILGHMAN@bdt.UUCP writes: >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)... >I can't find the current DTA address; is there any way that I can >do this while processing a TRAP #1? Since you're intercepting trap 1 calls, this should be cake. Trap 1 is not inherently non-reentrant, it's GEMDOS that makes it so. Your code could make a "real" trap 1 call into GEMDOS for the Fgetdta call. Making a "real" trap 1 call can be done two ways: either you replace the old trap 1 vector, make your call, then write yours in again, or your "fake" the trap 1 by creating a stack frame and jumping to the old vector. Any time you catch GEMDOS or BIOS traps, or create a trap or interrupt stack frame, you should be sure to check the system variable "longframe" at $59e (word). If it's nonzero, you are on a machine with "long frames" -- an extra word on the stack after the SR and PC. Only the 68000 has short frames; every other 680x0 has long frames. I am answering this in such detail because I want to forestall somebody else pointing out that you can look in the current process' basepage for its current DTA pointer. This is not a published fact, and therefore the location and meaning of that variable is subject to change. ============================================ Opinions expressed above do not necessarily -- Allan Pratt, Atari Corp. reflect those of Atari Corp. or anyone else. ...ames!atari!apratt