1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 17:29:50 +00:00

Optimize the inlined strlen.

This commit is contained in:
Piotr Fusik 2017-05-17 10:00:35 +02:00
parent 0291c92ffb
commit 6011bdb2f6

View File

@ -1245,9 +1245,8 @@ static void StdFunc_strlen (FuncDesc* F attribute ((unused)), ExprDesc* Expr)
AddCodeLine ("ldy #$FF"); AddCodeLine ("ldy #$FF");
g_defcodelabel (L); g_defcodelabel (L);
AddCodeLine ("iny"); AddCodeLine ("iny");
AddCodeLine ("lda %s,y", ED_GetLabelName (&Arg, 0)); AddCodeLine ("ldx %s,y", ED_GetLabelName (&Arg, 0));
AddCodeLine ("bne %s", LocalLabelName (L)); AddCodeLine ("bne %s", LocalLabelName (L));
AddCodeLine ("tax");
AddCodeLine ("tya"); AddCodeLine ("tya");
/* The function result is an rvalue in the primary register */ /* The function result is an rvalue in the primary register */