1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-14 16:33:00 +00:00

New --list-bytes option

git-svn-id: svn://svn.cc65.org/cc65/trunk@3019 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2004-05-10 21:50:13 +00:00
parent ab78147991
commit 1a68dd715a
2 changed files with 36 additions and 2 deletions

View File

@ -6,7 +6,7 @@
/* */
/* */
/* */
/* (C) 1998-2003 Ullrich von Bassewitz */
/* (C) 1998-2004 Ullrich von Bassewitz */
/* Römerstraße 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
@ -111,6 +111,7 @@ static void Usage (void)
" --ignore-case\t\tIgnore case of symbols\n"
" --include-dir dir\tSet an include directory search path\n"
" --listing\t\tCreate a listing if assembly was ok\n"
" --list-bytes n\tMaximum number of bytes per listing line\n"
" --memory-model model\tSet the memory model\n"
" --pagelength n\tSet the page length for the listing\n"
" --smart\t\tEnable smart mode\n"
@ -203,7 +204,7 @@ static void DefineSymbol (const char* Def)
static void OptAutoImport (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
const char* Arg attribute ((unused)))
/* Mark unresolved symbols as imported */
{
AutoImport = 1;
@ -271,6 +272,28 @@ static void OptIncludeDir (const char* Opt attribute ((unused)), const char* Arg
static void OptListBytes (const char* Opt, const char* Arg)
/* Set the maximum number of bytes per listing line */
{
unsigned Num;
char Check;
/* Convert the argument to a number */
if (sscanf (Arg, "%u%c", &Num, &Check) != 1) {
AbEnd ("Invalid argument for option `%s'", Opt);
}
/* Check the bounds */
if (Num != 0 && (Num < MIN_LIST_BYTES || Num > MAX_LIST_BYTES)) {
AbEnd ("Argument for option `%s' is out of range", Opt);
}
/* Use the value */
SetListBytes (Num);
}
static void OptListing (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Create a listing file */
@ -593,6 +616,7 @@ int main (int argc, char* argv [])
{ "--help", 0, OptHelp },
{ "--ignore-case", 0, OptIgnoreCase },
{ "--include-dir", 1, OptIncludeDir },
{ "--list-bytes", 1, OptListBytes },
{ "--listing", 0, OptListing },
{ "--memory-model", 1, OptMemoryModel },
{ "--pagelength", 1, OptPageLength },

View File

@ -646,6 +646,7 @@ static void Usage (void)
" --lib-path path\tSpecify a library search path\n"
" --list-targets\tList all available targets\n"
" --listing\t\tCreate an assembler listing\n"
" --list-bytes n\tNumber of bytes per assembler listing line\n"
" --mapfile name\tCreate a map file\n"
" --memory-model model\tSet the memory model\n"
" --module\t\tLink as a module\n"
@ -881,6 +882,14 @@ static void OptLibPath (const char* Opt attribute ((unused)), const char* Arg)
static void OptListBytes (const char* Opt attribute ((unused)), const char* Arg)
/* Set the maximum number of bytes per asm listing line */
{
CmdAddArg2 (&CA65, "--list-bytes", Arg);
}
static void OptListing (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Create an assembler listing */
@ -1108,6 +1117,7 @@ int main (int argc, char* argv [])
{ "--lib-path", 1, OptLibPath },
{ "--list-targets", 0, OptListTargets },
{ "--listing", 0, OptListing },
{ "--list-bytes", 1, OptListBytes },
{ "--mapfile", 1, OptMapFile },
{ "--memory-model", 1, OptMemoryModel },
{ "--module", 0, OptModule },