1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-15 17:30:06 +00:00

Fixed Issues #420 and #919 by always outputing the code segment before the three data segments for functions.

This commit is contained in:
acqn 2020-06-01 01:28:59 +08:00 committed by Oliver Schmidt
parent 33e103fdc6
commit 68f53e69f1
2 changed files with 7 additions and 4 deletions

View File

@ -1353,7 +1353,7 @@ void CS_OutputEpilogue (const CodeSeg* S)
*/
{
if (S->Func) {
WriteOutput ("\n.endproc\n\n");
WriteOutput (".endproc\n\n");
}
}
@ -1423,6 +1423,9 @@ void CS_Output (CodeSeg* S)
CE_Output (E);
}
/* Prettyier formatting */
WriteOutput ("\n");
/* If debug info is enabled, terminate the last line number information */
if (DebugInfo) {
WriteOutput ("\t.dbg\tline\n");

View File

@ -289,14 +289,14 @@ void OutputSegments (const Segments* S)
/* Output the text segment */
TS_Output (S->Text);
/* Output the code segment */
CS_Output (S->Code);
/* 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);
}