nppcutil.pas 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Helper routines for the PowerPC code generator
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit nppcutil;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. symtype,node,cpubase;
  23. procedure increfofs(var ref: treference; amount: longint);
  24. implementation
  25. uses
  26. globtype,globals,systems,verbose,
  27. cutils,
  28. aasm,cpuasm,
  29. symconst,symbase,symdef,symsym,symtable,
  30. {$ifdef GDB}
  31. gdb,
  32. {$endif GDB}
  33. types,
  34. ncon,nld,
  35. pass_1,pass_2,
  36. cgbase,temp_gen,
  37. cga,regvars,cgobj,cgcpu;
  38. procedure increfofs(var ref: treference; amount: longint);
  39. begin
  40. if (ref.index = R_NO) and
  41. ((ref.offset + amount) >= low(smallint)) and
  42. ((ref.offset + amount) <= high(smallint)) then
  43. inc(offset,amount)
  44. else
  45. begin
  46. cg.load_address_ref_reg(exprasmlist,ref,ref.base);
  47. ref.index := R_NO;
  48. ref.symbol := nil;
  49. ref.offset := amount;
  50. end;
  51. end.
  52. {
  53. $Log$
  54. Revision 1.6 2004-06-20 08:55:32 florian
  55. * logs truncated
  56. }