mirror of
https://github.com/cc65/cc65.git
synced 2025-08-08 06:25:17 +00:00
New option --memory-model
git-svn-id: svn://svn.cc65.org/cc65/trunk@2678 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -94,6 +94,7 @@ static void Usage (void)
|
|||||||
" -h\t\t\tHelp (this text)\n"
|
" -h\t\t\tHelp (this text)\n"
|
||||||
" -i\t\t\tIgnore case of symbols\n"
|
" -i\t\t\tIgnore case of symbols\n"
|
||||||
" -l\t\t\tCreate a listing if assembly was ok\n"
|
" -l\t\t\tCreate a listing if assembly was ok\n"
|
||||||
|
" -mm model\t\tSet the memory model\n"
|
||||||
" -o name\t\tName the output file\n"
|
" -o name\t\tName the output file\n"
|
||||||
" -s\t\t\tEnable smart mode\n"
|
" -s\t\t\tEnable smart mode\n"
|
||||||
" -t sys\t\tSet the target system\n"
|
" -t sys\t\tSet the target system\n"
|
||||||
@@ -108,6 +109,7 @@ static void Usage (void)
|
|||||||
" --ignore-case\t\tIgnore case of symbols\n"
|
" --ignore-case\t\tIgnore case of symbols\n"
|
||||||
" --include-dir dir\tSet an include directory search path\n"
|
" --include-dir dir\tSet an include directory search path\n"
|
||||||
" --listing\t\tCreate a listing if assembly was ok\n"
|
" --listing\t\tCreate a listing if assembly was ok\n"
|
||||||
|
" --memory-model model\tSet the memory model\n"
|
||||||
" --pagelength n\tSet the page length for the listing\n"
|
" --pagelength n\tSet the page length for the listing\n"
|
||||||
" --smart\t\tEnable smart mode\n"
|
" --smart\t\tEnable smart mode\n"
|
||||||
" --target sys\t\tSet the target system\n"
|
" --target sys\t\tSet the target system\n"
|
||||||
@@ -272,6 +274,20 @@ static void OptListing (const char* Opt attribute ((unused)),
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void OptMemoryModel (const char* Opt attribute ((unused)), const char* Arg)
|
||||||
|
/* Set the memory model */
|
||||||
|
{
|
||||||
|
if (strcmp (Arg, "near") == 0) {
|
||||||
|
DefAddrSize = ADDR_SIZE_ABS;
|
||||||
|
} else if (strcmp (Arg, "far") == 0) {
|
||||||
|
DefAddrSize = ADDR_SIZE_FAR;
|
||||||
|
} else {
|
||||||
|
AbEnd ("Unknown memory model: %s", Arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void OptPageLength (const char* Opt attribute ((unused)), const char* Arg)
|
static void OptPageLength (const char* Opt attribute ((unused)), const char* Arg)
|
||||||
/* Handle the --pagelength option */
|
/* Handle the --pagelength option */
|
||||||
{
|
{
|
||||||
@@ -509,6 +525,7 @@ int main (int argc, char* argv [])
|
|||||||
{ "--ignore-case", 0, OptIgnoreCase },
|
{ "--ignore-case", 0, OptIgnoreCase },
|
||||||
{ "--include-dir", 1, OptIncludeDir },
|
{ "--include-dir", 1, OptIncludeDir },
|
||||||
{ "--listing", 0, OptListing },
|
{ "--listing", 0, OptListing },
|
||||||
|
{ "--memory-model", 1, OptMemoryModel },
|
||||||
{ "--pagelength", 1, OptPageLength },
|
{ "--pagelength", 1, OptPageLength },
|
||||||
{ "--smart", 0, OptSmart },
|
{ "--smart", 0, OptSmart },
|
||||||
{ "--target", 1, OptTarget },
|
{ "--target", 1, OptTarget },
|
||||||
@@ -534,28 +551,36 @@ int main (int argc, char* argv [])
|
|||||||
const char* Arg = ArgVec [I];
|
const char* Arg = ArgVec [I];
|
||||||
|
|
||||||
/* Check for an option */
|
/* Check for an option */
|
||||||
if (Arg [0] == '-') {
|
if (Arg[0] == '-') {
|
||||||
switch (Arg [1]) {
|
switch (Arg[1]) {
|
||||||
|
|
||||||
case '-':
|
case '-':
|
||||||
LongOption (&I, OptTab, sizeof(OptTab)/sizeof(OptTab[0]));
|
LongOption (&I, OptTab, sizeof(OptTab)/sizeof(OptTab[0]));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'g':
|
case 'g':
|
||||||
OptDebugInfo (Arg, 0);
|
OptDebugInfo (Arg, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
OptHelp (Arg, 0);
|
OptHelp (Arg, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'i':
|
case 'i':
|
||||||
OptIgnoreCase (Arg, 0);
|
OptIgnoreCase (Arg, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
OptListing (Arg, 0);
|
OptListing (Arg, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'm':
|
||||||
|
if (Arg[2] == 'm') {
|
||||||
|
OptMemoryModel (Arg, GetArg (&I, 3));
|
||||||
|
} else {
|
||||||
|
UnknownOption (Arg);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 'o':
|
case 'o':
|
||||||
OutFile = GetArg (&I, 2);
|
OutFile = GetArg (&I, 2);
|
||||||
|
Reference in New Issue
Block a user