mirror of
https://github.com/cc65/cc65.git
synced 2025-08-09 13:25:06 +00:00
Changed g_addaddr_local() codegen to reduce code size.
This commit is contained in:
@@ -2112,6 +2112,14 @@ void g_addaddr_local (unsigned flags attribute ((unused)), int offs)
|
||||
|
||||
/* Add the offset */
|
||||
offs -= StackPtr;
|
||||
if (IS_Get (&CodeSizeFactor) <= 100) {
|
||||
if (offs != 0) {
|
||||
/* We cannot address more then 256 bytes of locals anyway */
|
||||
g_inc (CF_INT | CF_CONST, offs);
|
||||
}
|
||||
/* Add the current stackpointer value */
|
||||
AddCodeLine ("jsr leaaxsp");
|
||||
} else {
|
||||
if (offs != 0) {
|
||||
/* We cannot address more then 256 bytes of locals anyway */
|
||||
L = GetLocalLabel();
|
||||
@@ -2136,6 +2144,7 @@ void g_addaddr_local (unsigned flags attribute ((unused)), int offs)
|
||||
AddCodeLine ("tax");
|
||||
AddCodeLine ("tya");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user