void g_preamble (void)
/* Generate the assembler code preamble */
{
- /* Create a new (global) segment list and remember it */
- PushSegments (0);
- GS = CS;
-
/* Identify the compiler version */
AddTextLine (";");
AddTextLine ("; File generated by cc65 v %s", GetVersionAsString ());
/* DefineNumericMacro ("__STDC__", 1); <- not now */
DefineNumericMacro ("__STDC_HOSTED__", 1);
- /* Initialize the literal pool */
- InitLiteralPool ();
-
/* Create the base lexical level */
EnterGlobalLevel ();
+ /* Create the global code and data segments */
+ CreateGlobalSegments ();
+
+ /* Initialize the literal pool */
+ InitLiteralPool ();
+
/* Generate the code generator preamble */
g_preamble ();
+void CreateGlobalSegments (void)
+/* Create the global segments and remember them in GS */
+{
+ GS = PushSegments (0);
+}
+
+
+
void UseDataSeg (segment_t DSeg)
/* For the current segment list, use the data segment DSeg */
{
void PopSegments (void);
/* Pop the old segment list (make it current) */
+void CreateGlobalSegments (void);
+/* Create the global segments and remember them in GS */
+
void UseDataSeg (segment_t DSeg);
/* For the current segment list, use the data segment DSeg */