/* cc65 */
#include "codeseg.h"
#include "dataseg.h"
+#include "textseg.h"
#include "segments.h"
Segments* S = xmalloc (sizeof (Segments));
/* Initialize the fields */
+ S->Text = NewTextSeg (Func);
S->Code = NewCodeSeg (SegmentNames[SEG_CODE], Func);
S->Data = NewDataSeg (SegmentNames[SEG_DATA], Func);
S->ROData = NewDataSeg (SegmentNames[SEG_RODATA], Func);
+void AddTextLine (const char* Format, ...)
+/* Add a line of code to the current text segment */
+{
+ va_list ap;
+ va_start (ap, Format);
+ CHECK (CS != 0);
+ AddTextEntry (CS->Text, Format, ap);
+ va_end (ap);
+}
+
+
+
void AddCodeLine (const char* Format, ...)
/* Add a line of code to the current code segment */
{
PrintFunctionHeader (S->Code->Func, F);
}
+ /* Output the text segment */
+ OutputTextSeg (S->Text, F);
+
/* Output the three data segments */
OutputDataSeg (S->Data, F);
OutputDataSeg (S->ROData, F);