1 /*****************************************************************************/
5 /* Listing support for the ca65 crossassembler */
9 /* (C) 2000 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 /*****************************************************************************/
45 /*****************************************************************************/
47 /*****************************************************************************/
51 /* Length of the header of a listing line */
52 #define LINE_HEADER_LEN 24
54 /* One listing line as it is stored in memory */
55 typedef struct ListLine_ ListLine;
57 ListLine* Next; /* Pointer to next line */
58 Fragment* FragList; /* List of fragments for this line */
59 Fragment* FragLast; /* Last entry in fragment list */
60 unsigned long PC; /* Program counter for this line */
61 unsigned char Reloc; /* Relocatable mode? */
62 unsigned char File; /* From which file is the line? */
63 unsigned char Depth; /* Include depth */
64 unsigned char Output; /* Should we output this line? */
65 unsigned char ListBytes; /* How many bytes at max? */
66 char Line[1]; /* Line with dynamic length */
69 /* Single linked list of lines */
70 extern ListLine* LineList; /* List of listing lines */
71 extern ListLine* LineCur; /* Current listing line */
72 extern ListLine* LineLast; /* Last listing line */
75 #define MIN_PAGE_LEN 32
76 #define MAX_PAGE_LEN 127
77 extern int PageLength; /* Length of a listing page */
79 /* Byte for one listing line */
80 #define MIN_LIST_BYTES 4
81 #define MAX_LIST_BYTES 255
85 /*****************************************************************************/
87 /*****************************************************************************/
91 void NewListingLine (const char* Line, unsigned char File, unsigned char Depth);
92 /* Create a new ListLine struct */
94 void EnableListing (void);
95 /* Enable output of lines to the listing */
97 void DisableListing (void);
98 /* Disable output of lines to the listing */
100 void SetListBytes (int Bytes);
101 /* Set the maximum number of bytes listed for one line */
103 void InitListingLine (void);
104 /* Initialize the current listing line */
106 void CreateListing (void);
107 /* Create the listing */
111 /* End of listing.h */