X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Fsegments.h;h=fde43933d583c6de23abb5b078305e10dd09432e;hb=7c9bf720d8861c529f056532a308b1dbc94c25ab;hp=de66af9d7eba55a9cd1f185dec13bb6598a68c74;hpb=e6484f85c7f440aa8b12bbf956bed0b87e4ddeed;p=cc65 diff --git a/src/cc65/segments.h b/src/cc65/segments.h index de66af9d7..fde43933d 100644 --- a/src/cc65/segments.h +++ b/src/cc65/segments.h @@ -43,22 +43,27 @@ /* common */ #include "attrib.h" +/* cc65 */ +#include "opcodes.h" /*****************************************************************************/ -/* Forwards */ +/* Forwards */ /*****************************************************************************/ +struct CodeEntry; +struct CodeLabel; struct CodeSeg; struct DataSeg; +struct TextSeg; struct SymEntry; /*****************************************************************************/ -/* Data */ +/* Data */ /*****************************************************************************/ @@ -75,6 +80,7 @@ typedef enum segment_t { /* A list of all segments used when generating code */ typedef struct Segments Segments; struct Segments { + struct TextSeg* Text; /* Text segment */ struct CodeSeg* Code; /* Code segment */ struct DataSeg* Data; /* Data segment */ struct DataSeg* ROData; /* Readonly data segment */ @@ -85,6 +91,9 @@ struct Segments { /* Pointer to the current segment list. Output goes here. */ extern Segments* CS; +/* Pointer to the global segment list */ +extern Segments* GS; + /*****************************************************************************/ @@ -114,9 +123,15 @@ void UseDataSeg (segment_t DSeg); struct DataSeg* GetDataSeg (void); /* Return the current data segment */ +void AddTextLine (const char* Format, ...) attribute ((format (printf, 1, 2))); +/* Add a line to the current text segment */ + void AddCodeLine (const char* Format, ...) attribute ((format (printf, 1, 2))); /* Add a line of code to the current code segment */ +void AddCode (opc_t OPC, am_t AM, const char* Arg, struct CodeLabel* JumpTo); +/* Add a code entry to the current code segment */ + void AddDataLine (const char* Format, ...) attribute ((format (printf, 1, 2))); /* Add a line of data to the current data segment */