Added two new global options, NewlineAfterJMP and NewlineAfterRTS.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4963 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-02-05 16:03:06 +00:00
parent ae8f3d1f37
commit 7c1cd6c8d8
7 changed files with 64 additions and 17 deletions

View File

@@ -365,6 +365,16 @@ following attributes are recognized:
<tt><ref id="option--mnemonic-column" name="--mnemonic-column"></tt>. <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"> <label id="OUTPUTNAME">
<tag><tt/OUTPUTNAME/</tag> <tag><tt/OUTPUTNAME/</tag>
The attribute is followed by string value, which gives the name of the The attribute is followed by string value, which gives the name of the

View 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 FormFeeds = 0; /* Add form feeds to the output? */
unsigned char UseHexOffs = 0; /* Use hexadecimal label offsets */ unsigned char UseHexOffs = 0; /* Use hexadecimal label offsets */
unsigned char PassCount = 2; /* How many passed do we do? */ 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 StartAddr = -1L; /* Start/load address of the program */
long InputOffs = -1L; /* Offset into input file */ long InputOffs = -1L; /* Offset into input file */
long InputSize = -1L; /* Number of bytes to read from input */ long InputSize = -1L; /* Number of bytes to read from input */

View File

@@ -6,10 +6,10 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 2000-2006 Ullrich von Bassewitz */ /* (C) 2000-2011, Ullrich von Bassewitz */
/* R<EFBFBD>merstrasse 52 */ /* Roemerstrasse 52 */
/* D-70794 Filderstadt */ /* D-70794 Filderstadt */
/* EMail: uz@cc65.org */ /* EMail: uz@cc65.org */
/* */ /* */
/* */ /* */
/* This software is provided 'as-is', without any expressed or implied */ /* 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 FormFeeds; /* Add form feeds to the output? */
extern unsigned char UseHexOffs; /* Use hexadecimal label offsets */ extern unsigned char UseHexOffs; /* Use hexadecimal label offsets */
extern unsigned char PassCount; /* How many passed do we do? */ 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 StartAddr; /* Start/load address of the program */
extern long InputOffs; /* Offset into input file */ extern long InputOffs; /* Offset into input file */
extern long InputSize; /* Number of bytes to read from input */ extern long InputSize; /* Number of bytes to read from input */

View File

@@ -555,6 +555,9 @@ void OH_AbsoluteXIndirect (const OpcDesc* D attribute ((unused)))
void OH_Rts (const OpcDesc* D) void OH_Rts (const OpcDesc* D)
{ {
OH_Implicit (D); OH_Implicit (D);
if (NewlineAfterRTS) {
LineFeed ();
}
SeparatorLine(); SeparatorLine();
} }
@@ -563,6 +566,9 @@ void OH_Rts (const OpcDesc* D)
void OH_JmpAbsolute (const OpcDesc* D) void OH_JmpAbsolute (const OpcDesc* D)
{ {
OH_Absolute (D); OH_Absolute (D);
if (NewlineAfterJMP) {
LineFeed ();
}
SeparatorLine (); SeparatorLine ();
} }
@@ -571,7 +577,10 @@ void OH_JmpAbsolute (const OpcDesc* D)
void OH_JmpAbsoluteIndirect (const OpcDesc* D) void OH_JmpAbsoluteIndirect (const OpcDesc* D)
{ {
OH_AbsoluteIndirect (D); OH_AbsoluteIndirect (D);
SeparatorLine (); if (NewlineAfterJMP) {
LineFeed ();
}
SeparatorLine ();
} }

View File

@@ -6,10 +6,10 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 2000-2007 Ullrich von Bassewitz */ /* (C) 2000-2011, Ullrich von Bassewitz */
/* Roemerstrasse 52 */ /* Roemerstrasse 52 */
/* D-70794 Filderstadt */ /* D-70794 Filderstadt */
/* EMail: uz@cc65.org */ /* EMail: uz@cc65.org */
/* */ /* */
/* */ /* */
/* This software is provided 'as-is', without any expressed or implied */ /* This software is provided 'as-is', without any expressed or implied */
@@ -85,7 +85,7 @@ static void AsmIncSection (void)
{ {
static const IdentTok LabelDefs[] = { static const IdentTok LabelDefs[] = {
{ "COMMENTSTART", INFOTOK_COMMENTSTART }, { "COMMENTSTART", INFOTOK_COMMENTSTART },
{ "FILE", INFOTOK_FILE }, { "FILE", INFOTOK_FILE },
{ "IGNOREUNKNOWN", INFOTOK_IGNOREUNKNOWN }, { "IGNOREUNKNOWN", INFOTOK_IGNOREUNKNOWN },
}; };
@@ -190,6 +190,8 @@ static void GlobalSection (void)
{ "LABELBREAK", INFOTOK_LABELBREAK }, { "LABELBREAK", INFOTOK_LABELBREAK },
{ "MNEMONICCOL", INFOTOK_MNEMONIC_COLUMN }, { "MNEMONICCOL", INFOTOK_MNEMONIC_COLUMN },
{ "MNEMONICCOLUMN", INFOTOK_MNEMONIC_COLUMN }, { "MNEMONICCOLUMN", INFOTOK_MNEMONIC_COLUMN },
{ "NEWLINEAFTERJMP", INFOTOK_NL_AFTER_JMP },
{ "NEWLINEAFTERRTS", INFOTOK_NL_AFTER_RTS },
{ "OUTPUTNAME", INFOTOK_OUTPUTNAME }, { "OUTPUTNAME", INFOTOK_OUTPUTNAME },
{ "PAGELENGTH", INFOTOK_PAGELENGTH }, { "PAGELENGTH", INFOTOK_PAGELENGTH },
{ "STARTADDR", INFOTOK_STARTADDR }, { "STARTADDR", INFOTOK_STARTADDR },
@@ -298,6 +300,26 @@ static void GlobalSection (void)
InfoNextTok (); InfoNextTok ();
break; 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: case INFOTOK_OUTPUTNAME:
InfoNextTok (); InfoNextTok ();
InfoAssureStr (); InfoAssureStr ();

View File

@@ -6,7 +6,7 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 1998-2009, Ullrich von Bassewitz */ /* (C) 1998-2011, Ullrich von Bassewitz */
/* Roemerstrasse 52 */ /* Roemerstrasse 52 */
/* D-70794 Filderstadt */ /* D-70794 Filderstadt */
/* EMail: uz@cc65.org */ /* EMail: uz@cc65.org */
@@ -340,8 +340,8 @@ static void OptVersion (const char* Opt attribute ((unused)),
/* Print the disassembler version */ /* Print the disassembler version */
{ {
fprintf (stderr, fprintf (stderr,
"da65 V%s - (C) Copyright 2000-2009, Ullrich von Bassewitz\n", "da65 V%s - (C) Copyright 2000-2011, Ullrich von Bassewitz\n",
GetVersionAsString ()); GetVersionAsString ());
} }

View File

@@ -6,10 +6,10 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 2000-2007 Ullrich von Bassewitz */ /* (C) 2000-2011, Ullrich von Bassewitz */
/* Roemerstrasse 52 */ /* Roemerstrasse 52 */
/* D-70794 Filderstadt */ /* D-70794 Filderstadt */
/* EMail: uz@cc65.org */ /* EMail: uz@cc65.org */
/* */ /* */
/* */ /* */
/* This software is provided 'as-is', without any expressed or implied */ /* This software is provided 'as-is', without any expressed or implied */
@@ -78,6 +78,8 @@ typedef enum token_t {
INFOTOK_INPUTSIZE, INFOTOK_INPUTSIZE,
INFOTOK_LABELBREAK, INFOTOK_LABELBREAK,
INFOTOK_MNEMONIC_COLUMN, INFOTOK_MNEMONIC_COLUMN,
INFOTOK_NL_AFTER_JMP,
INFOTOK_NL_AFTER_RTS,
INFOTOK_OUTPUTNAME, INFOTOK_OUTPUTNAME,
INFOTOK_PAGELENGTH, INFOTOK_PAGELENGTH,
INFOTOK_STARTADDR, INFOTOK_STARTADDR,