Move global segment creation to a better place in source.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4498 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -145,10 +145,6 @@ static const char* GetLabelName (unsigned Flags, unsigned long Label, long Offs)
|
|||||||
void g_preamble (void)
|
void g_preamble (void)
|
||||||
/* Generate the assembler code preamble */
|
/* Generate the assembler code preamble */
|
||||||
{
|
{
|
||||||
/* Create a new (global) segment list and remember it */
|
|
||||||
PushSegments (0);
|
|
||||||
GS = CS;
|
|
||||||
|
|
||||||
/* Identify the compiler version */
|
/* Identify the compiler version */
|
||||||
AddTextLine (";");
|
AddTextLine (";");
|
||||||
AddTextLine ("; File generated by cc65 v %s", GetVersionAsString ());
|
AddTextLine ("; File generated by cc65 v %s", GetVersionAsString ());
|
||||||
|
|||||||
@@ -343,12 +343,15 @@ void Compile (const char* FileName)
|
|||||||
/* DefineNumericMacro ("__STDC__", 1); <- not now */
|
/* DefineNumericMacro ("__STDC__", 1); <- not now */
|
||||||
DefineNumericMacro ("__STDC_HOSTED__", 1);
|
DefineNumericMacro ("__STDC_HOSTED__", 1);
|
||||||
|
|
||||||
/* Initialize the literal pool */
|
|
||||||
InitLiteralPool ();
|
|
||||||
|
|
||||||
/* Create the base lexical level */
|
/* Create the base lexical level */
|
||||||
EnterGlobalLevel ();
|
EnterGlobalLevel ();
|
||||||
|
|
||||||
|
/* Create the global code and data segments */
|
||||||
|
CreateGlobalSegments ();
|
||||||
|
|
||||||
|
/* Initialize the literal pool */
|
||||||
|
InitLiteralPool ();
|
||||||
|
|
||||||
/* Generate the code generator preamble */
|
/* Generate the code generator preamble */
|
||||||
g_preamble ();
|
g_preamble ();
|
||||||
|
|
||||||
|
|||||||
@@ -183,6 +183,14 @@ void PopSegments (void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void CreateGlobalSegments (void)
|
||||||
|
/* Create the global segments and remember them in GS */
|
||||||
|
{
|
||||||
|
GS = PushSegments (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void UseDataSeg (segment_t DSeg)
|
void UseDataSeg (segment_t DSeg)
|
||||||
/* For the current segment list, use the data segment DSeg */
|
/* For the current segment list, use the data segment DSeg */
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -123,6 +123,9 @@ Segments* PushSegments (struct SymEntry* Func);
|
|||||||
void PopSegments (void);
|
void PopSegments (void);
|
||||||
/* Pop the old segment list (make it current) */
|
/* 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);
|
void UseDataSeg (segment_t DSeg);
|
||||||
/* For the current segment list, use the data segment DSeg */
|
/* For the current segment list, use the data segment DSeg */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user