home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1012 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: easy.in-chemnitz.de!mkmk!floh
  2. From: floh@mkmk.in-chemnitz.de (Andre Weissflog)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: __saveds
  5. Message-ID: <eW+Wx*5B0@mkmk.in-chemnitz.de>
  6. Date: Sat, 13 Jan 1996 22:09:18 CET
  7. Reply-To: floh@mkmk.in-chemnitz.de
  8. References: <747.6586T681T16@mbox3.swipnet.se>
  9. Distribution: world
  10. Organization: private uucp site
  11. X-Newsreader: Arn V 1.04
  12.  
  13. In article <747.6586T681T16@mbox3.swipnet.se>, Patrik Nilsson writes:
  14.  
  15. > void __saveds
  16. > dotcpline( int process )
  17. > {
  18. > int i;
  19. >    ...
  20. > }
  21. > What does "__saveds" mean?
  22. > Are there anything to think about when using "CreateNewProcTags"? 
  23. > I have nine processes using the same code, but it will only fail
  24. > to execute sometimes.
  25. > (I have seen others using "__saveds", are there other usefull
  26. > "__saveds"?)
  27.  
  28. When compiling with the small data model the generated
  29. code references global data relativ to the a4 register,
  30. instead of working with absolute 32 bit addresses. As long
  31. as all routines in your program are called from within
  32. your program, you don't need to care, since a4 always
  33. points to the beginning of the data section. But imagine,
  34. one of your routines gets called from "somewhere else".
  35. This "somewhere else" doesn't care about the global
  36. data of your program, so a4 will point to anything
  37. when your routine is entered. But your routine expects
  38. a4 to point to the global data, so ... caboom!
  39.  
  40. With __saveds (or __geta4 on DICE) you simply tell the compiler to
  41. generate code that saves a4 on the stack and initializes it with the
  42. start of your own data segment, thus solving the above mentioned
  43. problem.
  44.  
  45. > What are such tag as "__saveds" called?
  46. 'Compiler specific keywords' I guess.
  47.  
  48. Bye,
  49. -Floh.
  50.  
  51. ====//=== Andre Weissflog <floh@mkmk.in-chemnitz.de> =======
  52. ...// Sep'95: Return Of The Living Death...................
  53. \\// 90% of everything is crap (Sturgeon's Law)...........
  54. =\\===============================================Amiga!=
  55.  
  56.