More comment handling
git-svn-id: svn://svn.cc65.org/cc65/trunk@3389 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 2000-2003 Ullrich von Bassewitz */
|
/* (C) 2000-2005 Ullrich von Bassewitz */
|
||||||
/* R<>merstrasse 52 */
|
/* R<>merstrasse 52 */
|
||||||
/* D-70794 Filderstadt */
|
/* D-70794 Filderstadt */
|
||||||
/* EMail: uz@cc65.org */
|
/* EMail: uz@cc65.org */
|
||||||
@@ -387,17 +387,6 @@ unsigned char GetLabelAttr (unsigned Addr)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void DefineConst (unsigned Addr)
|
|
||||||
/* Define an address constant */
|
|
||||||
{
|
|
||||||
Output ("%s", SymTab[Addr]->Name);
|
|
||||||
Indent (AIndent);
|
|
||||||
Output ("= $%04X", Addr);
|
|
||||||
LineFeed ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void DefOutOfRangeLabels (void)
|
void DefOutOfRangeLabels (void)
|
||||||
/* Output any labels that are out of the loaded code range */
|
/* Output any labels that are out of the loaded code range */
|
||||||
{
|
{
|
||||||
@@ -409,7 +398,7 @@ void DefOutOfRangeLabels (void)
|
|||||||
Addr = 0;
|
Addr = 0;
|
||||||
while (Addr < CodeStart) {
|
while (Addr < CodeStart) {
|
||||||
if (MustDefLabel (Addr)) {
|
if (MustDefLabel (Addr)) {
|
||||||
DefineConst (Addr);
|
DefineConst (SymTab[Addr]->Name, SymTab[Addr]->Comment, Addr);
|
||||||
}
|
}
|
||||||
++Addr;
|
++Addr;
|
||||||
}
|
}
|
||||||
@@ -417,7 +406,7 @@ void DefOutOfRangeLabels (void)
|
|||||||
/* Skip areas in code range */
|
/* Skip areas in code range */
|
||||||
while (Addr <= CodeEnd) {
|
while (Addr <= CodeEnd) {
|
||||||
if ((AttrTab[Addr] & atStyleMask) == atSkip && MustDefLabel (Addr)) {
|
if ((AttrTab[Addr] & atStyleMask) == atSkip && MustDefLabel (Addr)) {
|
||||||
DefineConst (Addr);
|
DefineConst (SymTab[Addr]->Name, SymTab[Addr]->Comment, Addr);
|
||||||
}
|
}
|
||||||
++Addr;
|
++Addr;
|
||||||
}
|
}
|
||||||
@@ -425,7 +414,7 @@ void DefOutOfRangeLabels (void)
|
|||||||
/* High range */
|
/* High range */
|
||||||
while (Addr < 0x10000) {
|
while (Addr < 0x10000) {
|
||||||
if (MustDefLabel (Addr)) {
|
if (MustDefLabel (Addr)) {
|
||||||
DefineConst (Addr);
|
DefineConst (SymTab[Addr]->Name, SymTab[Addr]->Comment, Addr);
|
||||||
}
|
}
|
||||||
++Addr;
|
++Addr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 2000-2004 Ullrich von Bassewitz */
|
/* (C) 2000-2005 Ullrich von Bassewitz */
|
||||||
/* R<>merstrasse 52 */
|
/* R<>merstrasse 52 */
|
||||||
/* D-70794 Filderstadt */
|
/* D-70794 Filderstadt */
|
||||||
/* EMail: uz@cc65.org */
|
/* EMail: uz@cc65.org */
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 2000-2003 Ullrich von Bassewitz */
|
/* (C) 2000-2005 Ullrich von Bassewitz */
|
||||||
/* R<>merstrasse 52 */
|
/* R<>merstrasse 52 */
|
||||||
/* D-70794 Filderstadt */
|
/* D-70794 Filderstadt */
|
||||||
/* EMail: uz@cc65.org */
|
/* EMail: uz@cc65.org */
|
||||||
@@ -74,12 +74,12 @@ static void PageHeader (void)
|
|||||||
/* Print a page header */
|
/* Print a page header */
|
||||||
{
|
{
|
||||||
fprintf (F,
|
fprintf (F,
|
||||||
"; da65 V%u.%u.%u - (C) Copyright 2000-2003 Ullrich von Bassewitz\n"
|
"; da65 V%u.%u.%u - (C) Copyright 2000-2005 Ullrich von Bassewitz\n"
|
||||||
"; Input file: %s\n"
|
"; Input file: %s\n"
|
||||||
"; Page: %u\n\n",
|
"; Page: %u\n\n",
|
||||||
VER_MAJOR, VER_MINOR, VER_PATCH,
|
VER_MAJOR, VER_MINOR, VER_PATCH,
|
||||||
InFile,
|
InFile,
|
||||||
Page);
|
Page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -286,17 +286,17 @@ void LineComment (unsigned PC, unsigned Count)
|
|||||||
Output ("; %04X", PC);
|
Output ("; %04X", PC);
|
||||||
if (Comments >= 3) {
|
if (Comments >= 3) {
|
||||||
for (I = 0; I < Count; ++I) {
|
for (I = 0; I < Count; ++I) {
|
||||||
Output (" %02X", CodeBuf [PC+I]);
|
Output (" %02X", CodeBuf [PC+I]);
|
||||||
}
|
}
|
||||||
if (Comments >= 4) {
|
if (Comments >= 4) {
|
||||||
Indent (TIndent);
|
Indent (TIndent);
|
||||||
for (I = 0; I < Count; ++I) {
|
for (I = 0; I < Count; ++I) {
|
||||||
unsigned char C = CodeBuf [PC+I];
|
unsigned char C = CodeBuf [PC+I];
|
||||||
if (!isprint (C)) {
|
if (!isprint (C)) {
|
||||||
C = '.';
|
C = '.';
|
||||||
}
|
}
|
||||||
Output ("%c", C);
|
Output ("%c", C);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -318,3 +318,20 @@ void OutputSettings (void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void DefineConst (const char* Name, const char* Comment, unsigned Addr)
|
||||||
|
/* Define an address constant */
|
||||||
|
{
|
||||||
|
if (Pass == PassCount) {
|
||||||
|
Output ("%s", Name);
|
||||||
|
Indent (AIndent);
|
||||||
|
Output (":= $%04X", Addr);
|
||||||
|
if (Comment) {
|
||||||
|
Indent (CIndent);
|
||||||
|
Output ("; %s", Comment);
|
||||||
|
}
|
||||||
|
LineFeed ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,9 @@ void LineComment (unsigned PC, unsigned Count);
|
|||||||
void OutputSettings (void);
|
void OutputSettings (void);
|
||||||
/* Output CPU and other settings */
|
/* Output CPU and other settings */
|
||||||
|
|
||||||
|
void DefineConst (const char* Name, const char* Comment, unsigned Addr);
|
||||||
|
/* Define an address constant */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* End of output.h */
|
/* End of output.h */
|
||||||
|
|||||||
Reference in New Issue
Block a user