git-svn-id: svn://svn.cc65.org/cc65/trunk@338 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2000-09-24 20:54:49 +00:00
parent 16bc247cbf
commit 42fb5661f1
14 changed files with 549 additions and 98 deletions

View File

@@ -130,18 +130,44 @@ void DefLabel (const char* Name)
void OneDataByte (void)
/* Output a .byte line with the current code byte */
void DataByteLine (unsigned Count)
/* Output a line with Count data bytes */
{
unsigned char B = GetCodeByte ();
unsigned I;
if (Pass > 1) {
Indent (MIndent);
Output (".byte");
Indent (AIndent);
Output ("$%02X", B);
LineFeed ();
Indent (MIndent);
Output (".byte");
Indent (AIndent);
for (I = 0; I < Count; ++I) {
if (I > 0) {
Output (",$%02X", CodeBuf[PC+I]);
} else {
Output ("$%02X", CodeBuf[PC+I]);
}
}
LineComment (PC, Count);
LineFeed ();
}
void DataWordLine (unsigned Count)
/* Output a line with Count data words */
{
unsigned I;
Indent (MIndent);
Output (".word");
Indent (AIndent);
for (I = 0; I < Count; I += 2) {
if (I > 0) {
Output (",$%04X", GetCodeWord (PC+I));
} else {
Output ("$%04X", GetCodeWord (PC+I));
}
}
LineComment (PC, Count);
LineFeed ();
}
@@ -149,10 +175,25 @@ void OneDataByte (void)
void SeparatorLine (void)
/* Print a separator line */
{
Output ("; -------------------------------------------------------------------------");
Output ("; ----------------------------------------------------------------------------");
LineFeed ();
}
void LineComment (unsigned PC, unsigned Count)
/* Add a line comment with the PC and data bytes */
{
if (Pass > 1 && Verbosity >= 3) {
Indent (CIndent);
Output ("; %04X", PC);
if (Verbosity >= 4) {
while (Count--) {
Output (" %02X", CodeBuf [PC++]);
}
}
}
}