]> git.sur5r.net Git - cc65/commitdiff
Added two new global options, NewlineAfterJMP and NewlineAfterRTS.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 5 Feb 2011 16:03:06 +0000 (16:03 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 5 Feb 2011 16:03:06 +0000 (16:03 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4963 b7a2c559-68d2-44c3-8de9-860c34a00d81

doc/da65.sgml
src/da65/global.c
src/da65/global.h
src/da65/handler.c
src/da65/infofile.c
src/da65/main.c
src/da65/scanner.h

index bf934f1de8bf57a37e20437fba9f057b9409552c..d1a860189789a39db4aea5cbb431c9eccb48bdf3 100644 (file)
@@ -365,6 +365,16 @@ following attributes are recognized:
   <tt><ref id="option--mnemonic-column" name="--mnemonic-column"></tt>.
 
 
+  <tag><tt/NEWLINEAFTERJMP/</tag>
+  This attribute is followed by a boolean value. When true, a newline is
+  inserted after each <tt/JMP/ instruction. The default is false.
+
+
+  <tag><tt/NEWLINEAFTERRTS/</tag>
+  This attribute is followed by a boolean value. When true, a newline is
+  inserted after each <tt/RTS/ instruction. The default is false.       
+
+
   <label id="OUTPUTNAME">
   <tag><tt/OUTPUTNAME/</tag>
   The attribute is followed by string value, which gives the name of the
index 8f2a27aeec32df15092c4db305cb4785312f83ab..f3243f0d8bf9e6f55c294c382786ef0c26ab144b 100644 (file)
@@ -56,6 +56,8 @@ unsigned char DebugInfo       = 0;      /* Add debug info to the object file */
 unsigned char FormFeeds              = 0;      /* Add form feeds to the output? */
 unsigned char UseHexOffs      = 0;      /* Use hexadecimal label offsets */
 unsigned char PassCount              = 2;      /* How many passed do we do? */
+signed char   NewlineAfterJMP = -1;     /* Add a newline after a JMP insn? */
+signed char   NewlineAfterRTS = -1;     /* Add a newline after a RTS insn? */
 long         StartAddr       = -1L;    /* Start/load address of the program */
 long          InputOffs       = -1L;    /* Offset into input file */
 long          InputSize       = -1L;    /* Number of bytes to read from input */
index d8aafbdc17f8ee0b3a5a649c80b8b1bd399f3f0c..78680c93f19ee79f383b06ee034fd2cd3e34d506 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000-2006 Ullrich von Bassewitz                                       */
-/*               Römerstrasse 52                                             */
-/*               D-70794 Filderstadt                                         */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 2000-2011, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -57,6 +57,8 @@ extern unsigned char    DebugInfo;      /* Add debug info to the object file */
 extern unsigned char   FormFeeds;      /* Add form feeds to the output? */
 extern unsigned char    UseHexOffs;     /* Use hexadecimal label offsets */
 extern unsigned char   PassCount;      /* How many passed do we do? */
+extern signed char      NewlineAfterJMP;/* Add a newline after a JMP insn? */
+extern signed char      NewlineAfterRTS;/* Add a newline after a RTS insn? */
 extern long                    StartAddr;      /* Start/load address of the program */
 extern long             InputOffs;      /* Offset into input file */
 extern long             InputSize;      /* Number of bytes to read from input */
index 82a88bed210828991b9e1df75d0245ded9d68c9e..b5c2005eaffc5197da36f2f273f2afc33bb2211e 100644 (file)
@@ -555,6 +555,9 @@ void OH_AbsoluteXIndirect (const OpcDesc* D attribute ((unused)))
 void OH_Rts (const OpcDesc* D)
 {
     OH_Implicit (D);
+    if (NewlineAfterRTS) {
+        LineFeed ();
+    }
     SeparatorLine();
 }
 
@@ -563,6 +566,9 @@ void OH_Rts (const OpcDesc* D)
 void OH_JmpAbsolute (const OpcDesc* D)
 {
     OH_Absolute (D);
+    if (NewlineAfterJMP) {
+        LineFeed ();
+    }
     SeparatorLine ();
 }
 
@@ -571,7 +577,10 @@ void OH_JmpAbsolute (const OpcDesc* D)
 void OH_JmpAbsoluteIndirect (const OpcDesc* D)
 {
     OH_AbsoluteIndirect (D);
-    SeparatorLine ();
+    if (NewlineAfterJMP) {
+        LineFeed ();
+    }
+    SeparatorLine ();  
 }
 
 
index 4a96f700dc755fb58d1ba0f6fdccf8e342f67724..dba7a64ded5ee98f9c0f9e44308137e415f7655e 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000-2007 Ullrich von Bassewitz                                       */
-/*               Roemerstrasse 52                                            */
-/*               D-70794 Filderstadt                                         */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 2000-2011, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -85,7 +85,7 @@ static void AsmIncSection (void)
 {
     static const IdentTok LabelDefs[] = {
         {   "COMMENTSTART",     INFOTOK_COMMENTSTART    },
-               {   "FILE",             INFOTOK_FILE            },                     
+               {   "FILE",             INFOTOK_FILE            },
         {   "IGNOREUNKNOWN",    INFOTOK_IGNOREUNKNOWN   },
     };
 
@@ -190,6 +190,8 @@ static void GlobalSection (void)
         {   "LABELBREAK",       INFOTOK_LABELBREAK      },
         {   "MNEMONICCOL",      INFOTOK_MNEMONIC_COLUMN },
         {   "MNEMONICCOLUMN",   INFOTOK_MNEMONIC_COLUMN },
+        {   "NEWLINEAFTERJMP",  INFOTOK_NL_AFTER_JMP    },
+        {   "NEWLINEAFTERRTS",  INFOTOK_NL_AFTER_RTS    },
        {   "OUTPUTNAME",       INFOTOK_OUTPUTNAME      },
        {   "PAGELENGTH",       INFOTOK_PAGELENGTH      },
        {   "STARTADDR",        INFOTOK_STARTADDR       },
@@ -298,6 +300,26 @@ static void GlobalSection (void)
                InfoNextTok ();
                break;
 
+            case INFOTOK_NL_AFTER_JMP:
+                InfoNextTok ();
+                if (NewlineAfterJMP != -1) {
+                    InfoError ("NLAfterJMP already specified");
+                }
+                InfoBoolToken ();
+                NewlineAfterJMP = (InfoTok != INFOTOK_FALSE);
+                InfoNextTok ();
+                break;
+
+            case INFOTOK_NL_AFTER_RTS:
+                InfoNextTok ();
+                InfoBoolToken ();
+                if (NewlineAfterRTS != -1) {
+                    InfoError ("NLAfterRTS already specified");
+                }
+                NewlineAfterRTS = (InfoTok != INFOTOK_FALSE);
+                InfoNextTok ();
+                break;
+
            case INFOTOK_OUTPUTNAME:
                InfoNextTok ();
                InfoAssureStr ();
index aa48629ba5a8483f9c33e25f8738b1c93040c672..11262b77b6cbcd05189be010f7ce50ef644197fd 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2009, Ullrich von Bassewitz                                       */
+/* (C) 1998-2011, Ullrich von Bassewitz                                       */
 /*                Roemerstrasse 52                                            */
 /*                D-70794 Filderstadt                                         */
 /* EMail:         uz@cc65.org                                                 */
@@ -340,8 +340,8 @@ static void OptVersion (const char* Opt attribute ((unused)),
 /* Print the disassembler version */
 {
     fprintf (stderr,
-                    "da65 V%s - (C) Copyright 2000-2009, Ullrich von Bassewitz\n",
-                    GetVersionAsString ());  
+                    "da65 V%s - (C) Copyright 2000-2011, Ullrich von Bassewitz\n",
+                    GetVersionAsString ());
 }
 
 
index 4ca81774fbd91055efdf0b6e88359bcffdef5aac..d1eeec0241fb586d75d5bbfc602a840b5a6b2b3c 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000-2007 Ullrich von Bassewitz                                       */
-/*               Roemerstrasse 52                                            */
-/*               D-70794 Filderstadt                                         */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 2000-2011, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -78,6 +78,8 @@ typedef enum token_t {
     INFOTOK_INPUTSIZE,
     INFOTOK_LABELBREAK,
     INFOTOK_MNEMONIC_COLUMN,
+    INFOTOK_NL_AFTER_JMP,
+    INFOTOK_NL_AFTER_RTS,
     INFOTOK_OUTPUTNAME,
     INFOTOK_PAGELENGTH,
     INFOTOK_STARTADDR,