2000-05-28 13:40:48 +00:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/* */
|
|
|
|
|
/* fragment.h */
|
|
|
|
|
/* */
|
|
|
|
|
/* Data fragments for the ca65 crossassembler */
|
|
|
|
|
/* */
|
|
|
|
|
/* */
|
|
|
|
|
/* */
|
2003-06-03 22:19:46 +00:00
|
|
|
|
/* (C) 1998-2003 Ullrich von Bassewitz */
|
|
|
|
|
/* R<>merstrasse 52 */
|
|
|
|
|
/* D-70794 Filderstadt */
|
2001-05-23 08:51:48 +00:00
|
|
|
|
/* EMail: uz@cc65.org */
|
2000-05-28 13:40:48 +00:00
|
|
|
|
/* */
|
|
|
|
|
/* */
|
|
|
|
|
/* This software is provided 'as-is', without any expressed or implied */
|
|
|
|
|
/* warranty. In no event will the authors be held liable for any damages */
|
|
|
|
|
/* arising from the use of this software. */
|
|
|
|
|
/* */
|
|
|
|
|
/* Permission is granted to anyone to use this software for any purpose, */
|
|
|
|
|
/* including commercial applications, and to alter it and redistribute it */
|
|
|
|
|
/* freely, subject to the following restrictions: */
|
|
|
|
|
/* */
|
|
|
|
|
/* 1. The origin of this software must not be misrepresented; you must not */
|
|
|
|
|
/* claim that you wrote the original software. If you use this software */
|
|
|
|
|
/* in a product, an acknowledgment in the product documentation would be */
|
|
|
|
|
/* appreciated but is not required. */
|
|
|
|
|
/* 2. Altered source versions must be plainly marked as such, and must not */
|
|
|
|
|
/* be misrepresented as being the original software. */
|
|
|
|
|
/* 3. This notice may not be removed or altered from any source */
|
|
|
|
|
/* distribution. */
|
|
|
|
|
/* */
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef FRAGMENT_H
|
|
|
|
|
#define FRAGMENT_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-11-20 22:59:11 +00:00
|
|
|
|
/* common */
|
|
|
|
|
#include "exprdefs.h"
|
|
|
|
|
#include "filepos.h"
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-05-23 08:51:48 +00:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/* struct Fragment */
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct Fragment Fragment;
|
|
|
|
|
struct Fragment {
|
2003-06-03 22:19:46 +00:00
|
|
|
|
Fragment* Next; /* Pointer to next fragment in segment */
|
2000-05-28 13:40:48 +00:00
|
|
|
|
Fragment* LineList; /* List of fragments for one src line */
|
|
|
|
|
FilePos Pos; /* File position for this fragment */
|
2001-05-23 08:51:48 +00:00
|
|
|
|
struct LineInfo* LI; /* Extra line info */
|
2000-05-28 13:40:48 +00:00
|
|
|
|
unsigned short Len; /* Length for this fragment */
|
|
|
|
|
unsigned char Type; /* Fragment type */
|
|
|
|
|
union {
|
2003-11-04 19:02:11 +00:00
|
|
|
|
unsigned char Data[4]; /* Literal values */
|
2000-05-28 13:40:48 +00:00
|
|
|
|
ExprNode* Expr; /* Expression */
|
|
|
|
|
} V;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-10-21 20:34:56 +00:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/* Code */
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fragment* NewFragment (unsigned char Type, unsigned short Len);
|
|
|
|
|
/* Create, initialize and return a new fragment. The fragment will be inserted
|
|
|
|
|
* into the current segment.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
|
/* End of fragment.h */
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-05-23 08:51:48 +00:00
|
|
|
|
|