home *** CD-ROM | disk | FTP | other *** search
- Path: easy.in-chemnitz.de!mkmk!floh
- From: floh@mkmk.in-chemnitz.de (Andre Weissflog)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: __saveds
- Message-ID: <eW+Wx*5B0@mkmk.in-chemnitz.de>
- Date: Sat, 13 Jan 1996 22:09:18 CET
- Reply-To: floh@mkmk.in-chemnitz.de
- References: <747.6586T681T16@mbox3.swipnet.se>
- Distribution: world
- Organization: private uucp site
- X-Newsreader: Arn V 1.04
-
- In article <747.6586T681T16@mbox3.swipnet.se>, Patrik Nilsson writes:
-
- > void __saveds
- > dotcpline( int process )
- > {
- > int i;
- > ...
- > }
- >
- > What does "__saveds" mean?
- >
- > Are there anything to think about when using "CreateNewProcTags"?
- > I have nine processes using the same code, but it will only fail
- > to execute sometimes.
- >
- > (I have seen others using "__saveds", are there other usefull
- > "__saveds"?)
- >
-
- When compiling with the small data model the generated
- code references global data relativ to the a4 register,
- instead of working with absolute 32 bit addresses. As long
- as all routines in your program are called from within
- your program, you don't need to care, since a4 always
- points to the beginning of the data section. But imagine,
- one of your routines gets called from "somewhere else".
- This "somewhere else" doesn't care about the global
- data of your program, so a4 will point to anything
- when your routine is entered. But your routine expects
- a4 to point to the global data, so ... caboom!
-
- With __saveds (or __geta4 on DICE) you simply tell the compiler to
- generate code that saves a4 on the stack and initializes it with the
- start of your own data segment, thus solving the above mentioned
- problem.
-
- > What are such tag as "__saveds" called?
- >
- 'Compiler specific keywords' I guess.
-
- Bye,
- -Floh.
-
- ====//=== Andre Weissflog <floh@mkmk.in-chemnitz.de> =======
- ...// Sep'95: Return Of The Living Death...................
- \\// 90% of everything is crap (Sturgeon's Law)...........
- =\\===============================================Amiga!=
-
-