If main() takes arguments, generate a forced import to a special module
constructor which will setup command line arguments. git-svn-id: svn://svn.cc65.org/cc65/trunk@2011 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -157,16 +157,16 @@ void g_preamble (void)
|
||||
/* Identify the compiler version */
|
||||
AddTextLine (";");
|
||||
AddTextLine ("; File generated by cc65 v %u.%u.%u",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
AddTextLine (";");
|
||||
|
||||
/* Insert some object file options */
|
||||
AddTextLine ("\t.fopt\t\tcompiler,\"cc65 v %u.%u.%u\"",
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||
|
||||
/* If we're producing code for some other CPU, switch the command set */
|
||||
if (CPU == CPU_65C02) {
|
||||
AddTextLine ("\t.pc02");
|
||||
AddTextLine ("\t.pc02");
|
||||
}
|
||||
|
||||
/* Allow auto import for runtime library routines */
|
||||
@@ -189,7 +189,7 @@ void g_preamble (void)
|
||||
|
||||
void g_fileinfo (const char* Name, unsigned long Size, unsigned long MTime)
|
||||
/* If debug info is enabled, place a file info into the source */
|
||||
{
|
||||
{
|
||||
if (DebugInfo) {
|
||||
/* We have to place this into the global text segment, so it will
|
||||
* appear before all .dbg line statements.
|
||||
@@ -387,6 +387,14 @@ void g_defimport (const char* Name, int ZP)
|
||||
|
||||
|
||||
|
||||
void g_importmainargs (void)
|
||||
/* Forced import of a special symbol that handles arguments to main */
|
||||
{
|
||||
AddTextLine ("\t.forceimport\tinitmainargs");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Load functions for various registers */
|
||||
/*****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user