2
$Id: cgutils.pas,v 1.1 2004/02/27 10:21:05 florian Exp $
3
Copyright (c) 1998-2004 by Florian Klaempfl
5
Some basic types and constants for the code generation
7
This program is free software; you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 2 of the License, or
10
(at your option) any later version.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
****************************************************************************
23
{ This unit exports some helper routines which are used across the code generator }
35
{ trerefence handling }
37
{# Clear to zero a treference }
38
procedure reference_reset(var ref : treference);
39
{# Clear to zero a treference, and set is base address
42
procedure reference_reset_base(var ref : treference;base : tregister;offset : longint);
43
procedure reference_reset_symbol(var ref : treference;sym : tasmsymbol;offset : longint);
44
{ This routine verifies if two references are the same, and
45
if so, returns TRUE, otherwise returns false.
47
function references_equal(sref : treference;dref : treference) : boolean;
51
{****************************************************************************
53
****************************************************************************}
55
procedure reference_reset(var ref : treference);
57
FillChar(ref,sizeof(treference),0);
64
procedure reference_reset_base(var ref : treference;base : tregister;offset : longint);
72
procedure reference_reset_symbol(var ref : treference;sym : tasmsymbol;offset : longint);
80
function references_equal(sref : treference;dref : treference):boolean;
82
references_equal:=CompareByte(sref,dref,sizeof(treference))=0;
88
Revision 1.1 2004/02/27 10:21:05 florian
90
+ refaddr to treference added
91
+ refsymbol to treference added
92
* top_local stuff moved to an extra record to save memory
94
* tppufile.get/putint64/aint implemented