1 /*****************************************************************************/
5 /* Label management for da65 */
9 /* (C) 2006 Ullrich von Bassewitz */
10 /* Römerstrasse 52 */
11 /* D-70794 Filderstadt */
12 /* EMail: uz@cc65.org */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
45 /*****************************************************************************/
47 /*****************************************************************************/
51 void AddIntLabel (unsigned Addr);
52 /* Add an internal label using the address to generate the name. */
54 void AddExtLabel (unsigned Addr, const char* Name);
55 /* Add an external label */
57 void AddUnnamedLabel (unsigned Addr);
58 /* Add an unnamed label */
60 void AddDepLabel (unsigned Addr, attr_t Attr, const char* BaseName, unsigned Offs);
61 /* Add a dependent label at the given address using "base name+Offs" as the new
65 void AddIntLabelRange (unsigned Addr, const char* Name, unsigned Count);
66 /* Add an internal label for a range. The first entry gets the label "Name"
67 * while the others get "Name+offs".
70 void AddExtLabelRange (unsigned Addr, const char* Name, unsigned Count);
71 /* Add an external label for a range. The first entry gets the label "Name"
72 * while the others get "Name+offs".
75 int HaveLabel (unsigned Addr);
76 /* Check if there is a label for the given address */
78 int MustDefLabel (unsigned Addr);
79 /* Return true if we must define a label for this address, that is, if there
80 * is a label at this address, and it is an external or internal label.
83 const char* GetLabelName (unsigned Addr);
84 /* Return the label name for an address */
86 const char* GetLabel (unsigned Addr, unsigned RefFrom);
87 /* Return the label name for an address, as it is used in a label reference.
88 * RefFrom is the address the label is referenced from. This is needed in case
89 * of unnamed labels, to determine the name.
92 void ForwardLabel (unsigned Offs);
93 /* If necessary, output a forward label, one that is within the next few
94 * bytes and is therefore output as "label = * + x".
97 void DefOutOfRangeLabels (void);
98 /* Output any labels that are out of the loaded code range */
102 /* End of labels.h */