home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 2183 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.0 KB  |  57 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: chang.unx.sas.com!walker
  3. From: walker@chang.unx.sas.com (Doug Walker)
  4. Subject: Re: slink V6.56 problem
  5. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  6. Message-ID: <DLuw3q.FJ7@unx.sas.com>
  7. Date: Sat, 27 Jan 1996 20:11:50 GMT
  8. X-Nntp-Posting-Host: chang.unx.sas.com
  9. References: <4deus2$nm5@castle.nando.net> <4dlesn$hq9@oracle.rz.uni-ulm.de> <DLE9LC.Dp4@rose.com> <3102E962.2E3C@nando.net>
  10. Organization: SAS Institute Inc.
  11.  
  12. In article <3102E962.2E3C@nando.net>,
  13. Steve Krueger  <sekruege@nando.net> wrote:
  14. >A White wrote:
  15. >> 
  16. >> In article <4dlesn$hq9@oracle.rz.uni-ulm.de>,
  17. >> Jens-Steffen Gutmann <gutmann@informatik.uni-ulm.de> wrote:
  18. >> >
  19. >> >Another question: Why does slink work when I split the large
  20. >> >source file into pieces, compile each and link all together?
  21. >
  22. >Because it can insert an ALV between the functions for
  23. >calls that are >32k away. If it's all in the same .c
  24. >file, slink has nowhere to put the ALV.
  25. >
  26. >sk
  27.  
  28. To elaborate, the compiler generates 16-bit BSR instructions
  29. to call functions if CODE=NEAR is on.  Sometimes the target
  30. function is too far away to be reached with a 16-bit offset.
  31. If so, SLINK attempts to generate a JMP instruction (32-bit)
  32. that jumps to the function.  It tries to insert this JMP
  33. instruction between your code modules.  The BSR is modified
  34. to point to the JMP, which allows the program to keep working
  35. even though the destination function was too far away for a
  36. BSR.
  37.  
  38. If your code is so big that SLINK can't put a JMP instruction
  39. within 16k of the BSR instruction, this method won't work.
  40.  
  41. The JMP instruction that SLINK generates is called an "ALV",
  42. which means "Auto Load Vector" or something like that.  I
  43. don't really know where the name comes from.
  44.  
  45.  
  46.  
  47.  
  48.  
  49. -- 
  50.   *****                    / walker@unx.sas.com
  51.  *|_o_o|\\     Doug Walker<  BIX, Portal: djwalker
  52.  *|. o.| ||                \ AOL: weissblau
  53.   | o  |//     
  54.   ====== 
  55. Any opinions expressed are mine, not those of SAS Institute, Inc.
  56.  
  57.