1
0
mirror of https://github.com/cc65/cc65.git synced 2024-09-06 18:54:30 +00:00

Remove some 65C02 code generation that is now in the backend.

git-svn-id: svn://svn.cc65.org/cc65/trunk@1057 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2001-10-18 19:10:24 +00:00
parent 43530d1604
commit 86a90e463d

View File

@ -719,12 +719,8 @@ void g_getlocal (unsigned flags, int offs)
case CF_CHAR: case CF_CHAR:
if ((flags & CF_FORCECHAR) || (flags & CF_TEST)) { if ((flags & CF_FORCECHAR) || (flags & CF_TEST)) {
if (CPU == CPU_65C02 && offs == 0) {
AddCodeLine ("lda (sp)");
} else {
ldyconst (offs); ldyconst (offs);
AddCodeLine ("lda (sp),y"); AddCodeLine ("lda (sp),y");
}
} else { } else {
ldyconst (offs); ldyconst (offs);
AddCodeLine ("ldx #$00"); AddCodeLine ("ldx #$00");
@ -881,12 +877,8 @@ void g_leavariadic (int Offs)
CheckLocalOffs (ArgSizeOffs); CheckLocalOffs (ArgSizeOffs);
/* Get the size of all parameters. */ /* Get the size of all parameters. */
if (ArgSizeOffs == 0 && CPU == CPU_65C02) {
AddCodeLine ("lda (sp)");
} else {
ldyconst (ArgSizeOffs); ldyconst (ArgSizeOffs);
AddCodeLine ("lda (sp),y"); AddCodeLine ("lda (sp),y");
}
/* Add the value of the stackpointer */ /* Add the value of the stackpointer */
if (CodeSizeFactor > 250) { if (CodeSizeFactor > 250) {
@ -963,12 +955,8 @@ void g_putlocal (unsigned Flags, int Offs, long Val)
if (Flags & CF_CONST) { if (Flags & CF_CONST) {
AddCodeLine ("lda #$%02X", (unsigned char) Val); AddCodeLine ("lda #$%02X", (unsigned char) Val);
} }
if (CPU == CPU_65C02 && Offs == 0) {
AddCodeLine ("sta (sp)");
} else {
ldyconst (Offs); ldyconst (Offs);
AddCodeLine ("sta (sp),y"); AddCodeLine ("sta (sp),y");
}
break; break;
case CF_INT: case CF_INT:
@ -980,10 +968,6 @@ void g_putlocal (unsigned Flags, int Offs, long Val)
/* Place high byte into X */ /* Place high byte into X */
AddCodeLine ("tax"); AddCodeLine ("tax");
} }
if (CPU == CPU_65C02 && Offs == 0) {
AddCodeLine ("lda #$%02X", (unsigned char) Val);
AddCodeLine ("sta (sp)");
} else {
if ((Val & 0xFF) == Offs+1) { if ((Val & 0xFF) == Offs+1) {
/* The value we need is already in Y */ /* The value we need is already in Y */
AddCodeLine ("tya"); AddCodeLine ("tya");
@ -993,17 +977,10 @@ void g_putlocal (unsigned Flags, int Offs, long Val)
AddCodeLine ("lda #$%02X", (unsigned char) Val); AddCodeLine ("lda #$%02X", (unsigned char) Val);
} }
AddCodeLine ("sta (sp),y"); AddCodeLine ("sta (sp),y");
}
} else { } else {
if ((Flags & CF_NOKEEP) == 0 || CodeSizeFactor < 160) { if ((Flags & CF_NOKEEP) == 0 || CodeSizeFactor < 160) {
ldyconst (Offs); ldyconst (Offs);
AddCodeLine ("jsr staxysp"); AddCodeLine ("jsr staxysp");
} else {
if (CPU == CPU_65C02 && Offs == 0) {
AddCodeLine ("sta (sp)");
ldyconst (1);
AddCodeLine ("txa");
AddCodeLine ("sta (sp),y");
} else { } else {
ldyconst (Offs); ldyconst (Offs);
AddCodeLine ("sta (sp),y"); AddCodeLine ("sta (sp),y");
@ -1012,7 +989,6 @@ void g_putlocal (unsigned Flags, int Offs, long Val)
AddCodeLine ("sta (sp),y"); AddCodeLine ("sta (sp),y");
} }
} }
}
break; break;
case CF_LONG: case CF_LONG:
@ -3107,7 +3083,7 @@ void g_inc (unsigned flags, unsigned long val)
} }
} else { } else {
/* Inline the code */ /* Inline the code */
if (val < 0x300) { if (val <= 0x300) {
if ((val & 0xFF) != 0) { if ((val & 0xFF) != 0) {
unsigned L = GetLocalLabel(); unsigned L = GetLocalLabel();
AddCodeLine ("clc"); AddCodeLine ("clc");
@ -3122,6 +3098,9 @@ void g_inc (unsigned flags, unsigned long val)
if (val >= 0x200) { if (val >= 0x200) {
AddCodeLine ("inx"); AddCodeLine ("inx");
} }
if (val >= 0x300) {
AddCodeLine ("inx");
}
} else { } else {
AddCodeLine ("clc"); AddCodeLine ("clc");
if ((val & 0xFF) != 0) { if ((val & 0xFF) != 0) {