From bf5ae8b663b42d35c5aa7e4a1898fb46665979cd Mon Sep 17 00:00:00 2001 From: cuz Date: Tue, 26 Nov 2002 18:23:44 +0000 Subject: [PATCH] Add compiler options for register variables git-svn-id: svn://svn.cc65.org/cc65/trunk@1652 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cl65/main.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/cl65/main.c b/src/cl65/main.c index bf7b8dceb..5de2ebfbe 100644 --- a/src/cl65/main.c +++ b/src/cl65/main.c @@ -602,6 +602,7 @@ static void Usage (void) " -l\t\t\tCreate an assembler listing\n" " -m name\t\tCreate a map file\n" " -o name\t\tName the output file\n" + " -r\t\t\tEnable register variables\n" " -t sys\t\tSet the target system\n" " -v\t\t\tVerbose mode\n" " -vm\t\t\tVerbose map file\n" @@ -640,6 +641,8 @@ static void Usage (void) " --mapfile name\tCreate a map file\n" " --module\t\tLink as a module\n" " --module-id id\tSpecify a module id for the linker\n" + " --register-space b\tSet space available for register variables\n" + " --register-vars\tEnable register variables\n" " --rodata-name seg\tSet the name of the RODATA segment\n" " --signed-chars\tDefault characters are signed\n" " --start-addr addr\tSet the default start address\n" @@ -831,6 +834,24 @@ static void OptModuleId (const char* Opt attribute ((unused)), const char* Arg) +static void OptRegisterSpace (const char* Opt attribute ((unused)), const char* Arg) +/* Handle the --register-space option */ +{ + CmdAddArg (&CC65, "--register-space"); + CmdAddArg (&CC65, Arg); +} + + + +static void OptRegisterVars (const char* Opt attribute ((unused)), + const char* Arg attribute ((unused))) +/* Handle the --register-vars option */ +{ + CmdAddArg (&CC65, "-r"); +} + + + static void OptRodataName (const char* Opt attribute ((unused)), const char* Arg) /* Handle the --rodata-name option */ { @@ -926,6 +947,8 @@ int main (int argc, char* argv []) { "--mapfile", 1, OptMapFile }, { "--module", 0, OptModule }, { "--module-id", 1, OptModuleId }, + { "--register-space", 1, OptRegisterSpace }, + { "--register-vars", 0, OptRegisterVars }, { "--rodata-name", 1, OptRodataName }, { "--signed-chars", 0, OptSignedChars }, { "--start-addr", 1, OptStartAddr }, @@ -1069,6 +1092,11 @@ int main (int argc, char* argv []) OutputName = GetArg (&I, 2); break; + case 'r': + /* Enable register variables */ + OptRegisterVars (Arg, 0); + break; + case 't': /* Set target system - compiler, assembler and linker */ OptTarget (Arg, GetArg (&I, 2)); -- 2.39.5