home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / amiga / programm / 15901 < prev    next >
Encoding:
Text File  |  1992-11-16  |  2.7 KB  |  61 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!uvaarpa!concert!sas!mozart.unx.sas.com!walker
  3. From: walker@twix.unx.sas.com (Doug Walker)
  4. Subject: Re: help with error: NEAR/FAR reference
  5. Originator: walker@twix.unx.sas.com
  6. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  7. Message-ID: <BxtAtJ.KC6@unx.sas.com>
  8. Date: Mon, 16 Nov 1992 13:58:30 GMT
  9. References:  <1992Nov14.232146.2366@sol.UVic.CA>
  10. Nntp-Posting-Host: twix.unx.sas.com
  11. Organization: SAS Institute Inc.
  12. Lines: 47
  13.  
  14.  
  15. In article <1992Nov14.232146.2366@sol.UVic.CA>, aramsey@ugly.UVic.CA (Aaron  Ramsey) writes:
  16. |> I've got a program that gives me a warning.. and I can't figure it out..
  17. |> 
  18. |> <programname> 209 Warning 169: too much global data for NEAR reference, change
  19. |>                    some to FAR
  20. |> 
  21. |> How do I change it to FAR reference? I'm using SAS 5.10. I tried moving my
  22.  
  23. Put the __far keyword on one or more of your larger data items,
  24. or compile with the -b0 option to make all data references far.
  25. If you use -b0, make sure to link with the 'nb' versions of the
  26. libraries - the LC command will do this automatically for you,
  27. but if you use BLINK directly, you will have to modify your
  28. library list.
  29.  
  30. |> subroutines around to try and compensate for any jumps being made by calls to
  31. |> subroutines, but it made no difference. This error shows up at the very 
  32. |> last line of my program (which happens to be blank). How can I get rid of this?
  33. |> And what is causing it exactly? My main() is about 160 line or so, with
  34. |> quite a few if statements... nothing that I would have thought would take
  35. |> up tons of memory when put into assemly... I dunno.
  36.  
  37. It isn't your CODE that's too big, it's your DATA - read the message.
  38. You have more data than can be accessed via a 16-bit offset, so you
  39. have to tell the compiler to generate 32-bit offsets to at least 
  40. some of it.  The __far keyword tells it to generate 32-bit offsets
  41. to the marked items; -b0 tells it to generate 32-bit offsets to
  42. everything.
  43.  
  44. Another thing to consider would be to allocate space for that large
  45. array dynamically instead of declaring it as an extern.  Use the
  46. malloc() function and the memory will automatically be freed when
  47. you exit.  (I assume you have a large array since I doubt that you
  48. have declared 64k worth of non-array "int" variables 8^)
  49.  
  50. |> -Aaron Ramsey...........  bewildered beginning C programmer.  8-)
  51.  
  52. -- 
  53.   *****
  54. =*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
  55.  *|. o.| ||                                          1200/2400/9600 Dual
  56.   | o  |//     For all you do, this bug's for you!
  57.   ====== 
  58. usenet: walker@unx.sas.com                            bix: djwalker 
  59. Any opinions expressed are mine, not those of SAS Institute, Inc.
  60.  
  61.