--macpack-dir dir Set a macro package directory
--memory-model model Set the memory model
--pagelength n Set the page length for the listing
+ --relax-checks Relax some checks (see docs)
--smart Enable smart mode
--target sys Set the target system
--verbose Increase verbosity
id=".PAGELENGTH" name=".PAGELENGTH"></tt> directive for more information.
+ <label id="option--relax-checks">
+ <tag><tt>--relax-checks</tt></tag>
+
+ Relax some checks done by the assembler. This will allow code that is an
+ error in most cases and flagged as such by the assembler, but can be valid
+ in special situations.
+
+ Examples are:
+<itemize>
+<item>Short branches between two different segments.
+<item>Byte sized address loads where the address is not a zeropage address.
+</itemize>
+
+
<label id="option-s">
<tag><tt>-s, --smart-mode</tt></tag>
unsigned char DbgSyms = 0; /* Add debug symbols */
unsigned char LineCont = 0; /* Allow line continuation */
unsigned char LargeAlignment = 0; /* Don't warn about large alignments */
+unsigned char RelaxChecks = 0; /* Relax a few assembler checks */
/* Emulation features */
unsigned char DollarIsPC = 0; /* Allow the $ symbol as current PC */
unsigned char OrgPerSeg = 0; /* Make .org local to current seg */
unsigned char CComments = 0; /* Allow C like comments */
unsigned char ForceRange = 0; /* Force values into expected range */
-
+
/* Misc stuff */
const char Copyright[] = "(C) Copyright 1998-2011 Ullrich von Bassewitz";
extern unsigned char DbgSyms; /* Add debug symbols */
extern unsigned char LineCont; /* Allow line continuation */
extern unsigned char LargeAlignment; /* Don't warn about large alignments */
+extern unsigned char RelaxChecks; /* Relax a few assembler checks */
/* Emulation features */
extern unsigned char DollarIsPC; /* Allow the $ symbol as current PC */
/* */
/* */
/* */
-/* (C) 1998-2011, Ullrich von Bassewitz */
+/* (C) 1998-2012, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
" --macpack-dir dir\t\tSet a macro package directory\n"
" --memory-model model\t\tSet the memory model\n"
" --pagelength n\t\tSet the page length for the listing\n"
+ " --relax-checks\t\tRelax some checks (see docs)\n"
" --smart\t\t\tEnable smart mode\n"
" --target sys\t\t\tSet the target system\n"
" --verbose\t\t\tIncrease verbosity\n"
+static void OptRelaxChecks (const char* Opt attribute ((unused)),
+ const char* Arg attribute ((unused)))
+/* Handle the --relax-checks options */
+{
+ RelaxChecks = 1;
+}
+
+
+
static void OptSmart (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Handle the -s/--smart options */
{ "--macpack-dir", 1, OptMacPackDir },
{ "--memory-model", 1, OptMemoryModel },
{ "--pagelength", 1, OptPageLength },
+ { "--relax-checks", 0, OptRelaxChecks },
{ "--smart", 0, OptSmart },
{ "--target", 1, OptTarget },
{ "--verbose", 0, OptVerbose },
}
F->Type = FRAG_LITERAL;
- } else {
+ } else if (RelaxChecks == 0) {
- /* Simplify the expression */
- /* ### F->V.Expr = SimplifyExpr (F->V.Expr, &ED); */
-
- /* We cannot evaluate the expression now, leave the job for
- * the linker. However, we can check if the address size
- * matches the fragment size, and we will do so.
- */
+ /* We cannot evaluate the expression now, leave the job for
+ * the linker. However, we can check if the address size
+ * matches the fragment size. Mismatches are errors in
+ * most situations.
+ */
if ((F->Len == 1 && ED.AddrSize > ADDR_SIZE_ZP) ||
(F->Len == 2 && ED.AddrSize > ADDR_SIZE_ABS) ||
(F->Len == 3 && ED.AddrSize > ADDR_SIZE_FAR)) {
- LIError (&F->LI, "Range error");
- }
+ LIError (&F->LI, "Range error");
+ }
}
/* Release memory allocated for the expression decriptor */