1 /*****************************************************************************/
5 /* Module to handle the o65 binary format */
9 /* (C) 1999-2001 Ullrich von Bassewitz */
11 /* D-70597 Stuttgart */
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 /*****************************************************************************/
48 /*****************************************************************************/
50 /*****************************************************************************/
54 /* Structure describing the format */
55 typedef struct O65Desc O65Desc;
58 #define O65OPT_FILENAME 0
61 #define O65OPT_AUTHOR 3
62 #define O65OPT_TIMESTAMP 4
64 /* Operating system codes for O65OPT_OS */
71 /*****************************************************************************/
73 /*****************************************************************************/
77 O65Desc* NewO65Desc (void);
78 /* Create, initialize and return a new O65 descriptor struct */
80 void FreeO65Desc (O65Desc* D);
81 /* Delete the descriptor struct with cleanup */
83 void O65Set6502 (O65Desc* D);
84 /* Enable 6502 mode */
86 void O65Set65816 (O65Desc* D);
89 void O65SetSmallModel (O65Desc* D);
90 /* Enable a small memory model executable */
92 void O65SetLargeModel (O65Desc* D);
93 /* Enable a large memory model executable */
95 void O65SetAlignment (O65Desc* D, unsigned Align);
96 /* Set the executable alignment */
98 void O65SetOption (O65Desc* D, unsigned Type, const void* Data, unsigned DataLen);
99 /* Set an o65 header option */
101 void O65SetOS (O65Desc* D, unsigned OS, unsigned Version, unsigned Id);
102 /* Set an option describing the target operating system */
104 ExtSym* O65GetImport (O65Desc* D, const char* Ident);
105 /* Return the imported symbol or NULL if not found */
107 void O65SetImport (O65Desc* D, const char* Ident);
108 /* Set an imported identifier */
110 ExtSym* O65GetExport (O65Desc* D, const char* Ident);
111 /* Return the exported symbol or NULL if not found */
113 void O65SetExport (O65Desc* D, const char* Ident);
114 /* Set an exported identifier */
116 void O65WriteTarget (O65Desc* D, File* F);
117 /* Write an o65 output file */