diff --git a/doc/ca65.sgml b/doc/ca65.sgml
index 4a14d0276..af762b90a 100644
--- a/doc/ca65.sgml
+++ b/doc/ca65.sgml
@@ -92,6 +92,7 @@ Short options:
-U Mark unresolved symbols as import
-V Print the assembler version
-W n Set warning level n
+ -d Debug mode
-g Add debug info to object file
-h Help (this text)
-i Ignore case of symbols
@@ -108,6 +109,7 @@ Long options:
--cpu type Set cpu type
--create-dep name Create a make dependency file
--create-full-dep name Create a full make dependency file
+ --debug Debug mode
--debug-info Add debug info to object file
--feature name Set an emulation feature
--forget-inc-paths Forget include search paths
@@ -175,6 +177,12 @@ Here is a description of all the command line options:
information to the assembler.
+ -d, --debug
+
+ Enables debug mode, something that should not be needed for mere
+ mortals:-)
+
+
--feature name
diff --git a/src/ca65/main.c b/src/ca65/main.c
index f4aa4087c..bcc9e889e 100644
--- a/src/ca65/main.c
+++ b/src/ca65/main.c
@@ -1,4 +1,4 @@
-/*****************************************************************************/
+
/* */
/* main.c */
/* */
@@ -42,6 +42,7 @@
#include "addrsize.h"
#include "chartype.h"
#include "cmdline.h"
+#include "debugflag.h"
#include "mmodel.h"
#include "print.h"
#include "scopedefs.h"
@@ -97,6 +98,7 @@ static void Usage (void)
" -U\t\t\t\tMark unresolved symbols as import\n"
" -V\t\t\t\tPrint the assembler version\n"
" -W n\t\t\t\tSet warning level n\n"
+ " -d\t\t\t\tDebug mode\n"
" -g\t\t\t\tAdd debug info to object file\n"
" -h\t\t\t\tHelp (this text)\n"
" -i\t\t\t\tIgnore case of symbols\n"
@@ -113,6 +115,7 @@ static void Usage (void)
" --cpu type\t\t\tSet cpu type\n"
" --create-dep name\t\tCreate a make dependency file\n"
" --create-full-dep name\tCreate a full make dependency file\n"
+ " --debug\t\t\tDebug mode\n"
" --debug-info\t\t\tAdd debug info to object file\n"
" --feature name\t\tSet an emulation feature\n"
" --forget-inc-paths\t\tForget include search paths\n"
@@ -407,6 +410,15 @@ static void OptCreateFullDep (const char* Opt attribute ((unused)),
+static void OptDebug (const char* Opt attribute ((unused)),
+ const char* Arg attribute ((unused)))
+/* Compiler debug mode */
+{
+ ++Debug;
+}
+
+
+
static void OptDebugInfo (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Add debug info to the object file */
@@ -869,6 +881,7 @@ int main (int argc, char* argv [])
{ "--cpu", 1, OptCPU },
{ "--create-dep", 1, OptCreateDep },
{ "--create-full-dep", 1, OptCreateFullDep },
+ { "--debug", 0, OptDebug },
{ "--debug-info", 0, OptDebugInfo },
{ "--feature", 1, OptFeature },
{ "--forget-inc-paths", 0, OptForgetIncPaths },
@@ -930,6 +943,10 @@ int main (int argc, char* argv [])
LongOption (&I, OptTab, sizeof(OptTab)/sizeof(OptTab[0]));
break;
+ case 'd':
+ OptDebug (Arg, 0);
+ break;
+
case 'g':
OptDebugInfo (Arg, 0);
break;
diff --git a/src/ca65/studyexpr.c b/src/ca65/studyexpr.c
index e5141702f..cef121223 100644
--- a/src/ca65/studyexpr.c
+++ b/src/ca65/studyexpr.c
@@ -37,7 +37,7 @@
/* common */
#include "check.h"
-#include "print.h"
+#include "debugflag.h"
#include "shift.h"
#include "xmalloc.h"
@@ -537,7 +537,7 @@ static void StudySymbol (ExprNode* Expr, ExprDesc* D)
SymUnmarkUser (Sym);
/* If requested and if the expression is valid, dump it */
- if (Verbosity > 0 && !ED_HasError (D)) {
+ if (Debug > 0 && !ED_HasError (D)) {
DumpExpr (Expr, SymResolve);
}