mirror of
https://github.com/cc65/cc65.git
synced 2025-01-14 16:33:00 +00:00
Fixed a problem with a memcpy optimization (source and target have been
swapped). git-svn-id: svn://svn.cc65.org/cc65/trunk@5796 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
7ab3ede933
commit
3c9f722fbf
@ -477,15 +477,15 @@ static void StdFunc_memcpy (FuncDesc* F attribute ((unused)), ExprDesc* Expr)
|
|||||||
if (Arg3.Expr.IVal <= 127) {
|
if (Arg3.Expr.IVal <= 127) {
|
||||||
AddCodeLine ("ldy #$%02X", (unsigned char) (Arg3.Expr.IVal - 1));
|
AddCodeLine ("ldy #$%02X", (unsigned char) (Arg3.Expr.IVal - 1));
|
||||||
g_defcodelabel (Label);
|
g_defcodelabel (Label);
|
||||||
AddCodeLine ("lda (ptr1),y");
|
AddCodeLine ("lda (sp),y");
|
||||||
AddCodeLine ("sta (sp),y");
|
AddCodeLine ("sta (ptr1),y");
|
||||||
AddCodeLine ("dey");
|
AddCodeLine ("dey");
|
||||||
AddCodeLine ("bpl %s", LocalLabelName (Label));
|
AddCodeLine ("bpl %s", LocalLabelName (Label));
|
||||||
} else {
|
} else {
|
||||||
AddCodeLine ("ldy #$00");
|
AddCodeLine ("ldy #$00");
|
||||||
g_defcodelabel (Label);
|
g_defcodelabel (Label);
|
||||||
AddCodeLine ("lda (ptr1),y");
|
AddCodeLine ("lda (sp),y");
|
||||||
AddCodeLine ("sta (sp),y");
|
AddCodeLine ("sta (ptr1),y");
|
||||||
AddCodeLine ("iny");
|
AddCodeLine ("iny");
|
||||||
AddCodeLine ("cpy #$%02X", (unsigned char) Arg3.Expr.IVal);
|
AddCodeLine ("cpy #$%02X", (unsigned char) Arg3.Expr.IVal);
|
||||||
AddCodeLine ("bne %s", LocalLabelName (Label));
|
AddCodeLine ("bne %s", LocalLabelName (Label));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user