Example #1
0
File: codeopt.c Project: coyxc/cc65
static void WriteDebugOutput (CodeSeg* S, const char* Step)
/* Write a separator line into the debug file if the flag is on */
{
    if (DebugOptOutput) {
        /* Output a separator */
        WriteOutput ("=========================================================================\n");

        /* Output a header line */
        if (Step == 0) {
            /* Initial output */
            WriteOutput ("Initial code for function `%s':\n",
                         S->Func? S->Func->Name : "<global>");
        } else {
            WriteOutput ("Code after applying `%s':\n", Step);
        }

        /* Output the code segment */
        CS_Output (S);
    }
}
Example #2
0
void OutputSegments (const Segments* S)
/* Output the given segments to the output file */
{
    /* Output the function prologue if the segments came from a function */
    CS_OutputPrologue (S->Code);

    /* Output the text segment */
    TS_Output (S->Text);

    /* Output the three data segments */
    DS_Output (S->Data);
    DS_Output (S->ROData);
    DS_Output (S->BSS);

    /* Output the code segment */
    CS_Output (S->Code);

    /* Output the code segment epiloque */
    CS_OutputEpilogue (S->Code);
}