1 /*****************************************************************************/
5 /* Segment definitions for the bin65 binary utils */
9 /* (C) 1998-2002 Ullrich von Bassewitz */
11 /* D-70597 Stuttgart */
12 /* EMail: uz@musoftware.de */
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 /*****************************************************************************/
41 /*****************************************************************************/
43 /*****************************************************************************/
47 /* Available segment types */
48 #define SEGTYPE_DEFAULT 0
53 /* Default segment names */
54 #define SEGNAME_NULL "NULL"
55 #define SEGNAME_ZP "ZEROPAGE"
56 #define SEGNAME_DATA "DATA"
57 #define SEGNAME_BSS "BSS"
58 #define SEGNAME_RODATA "RODATA"
59 #define SEGNAME_CODE "CODE"
61 /* Fragment types in the object file */
62 #define FRAG_TYPEMASK 0x38 /* Mask the type of the fragment */
63 #define FRAG_BYTEMASK 0x07 /* Mask for byte count */
65 #define FRAG_LITERAL 0x00 /* Literal data */
67 #define FRAG_EXPR 0x08 /* Expression */
68 #define FRAG_EXPR8 0x09 /* 8 bit expression */
69 #define FRAG_EXPR16 0x0A /* 16 bit expression */
70 #define FRAG_EXPR24 0x0B /* 24 bit expression */
71 #define FRAG_EXPR32 0x0C /* 32 bit expression */
73 #define FRAG_SEXPR 0x10 /* Signed expression */
74 #define FRAG_SEXPR8 0x11 /* 8 bit signed expression */
75 #define FRAG_SEXPR16 0x12 /* 16 bit signed expression */
76 #define FRAG_SEXPR24 0x13 /* 24 bit signed expression */
77 #define FRAG_SEXPR32 0x14 /* 32 bit signed expression */
79 #define FRAG_FILL 0x20 /* Fill bytes */
83 /* Segment definition */
84 typedef struct SegDef SegDef;
86 char* Name; /* Segment name */
87 unsigned Type; /* Segment type, see above */
90 /* Initializer for static SegDefs */
91 #define STATIC_SEGDEF_INITIALIZER(name, type) { (name), (type) }
95 /*****************************************************************************/
97 /*****************************************************************************/
101 SegDef* NewSegDef (const char* Name, unsigned Type);
102 /* Create a new segment definition and return it */
104 void FreeSegDef (SegDef* D);
105 /* Free a segment definition */
107 SegDef* DupSegDef (const SegDef* D);
108 /* Duplicate a segment definition and return it */
110 int ValidSegName (const char* Name);
111 /* Return true if the given segment name is valid, return false otherwise */
115 /* End of segdefs.h */