1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-08 15:29:37 +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");
g_defcodelabel (L);
AddCodeLine ("iny");
AddCodeLine ("lda %s,y", ED_GetLabelName (&Arg, 0));
AddCodeLine ("ldx %s,y", ED_GetLabelName (&Arg, 0));
AddCodeLine ("bne %s", LocalLabelName (L));
AddCodeLine ("tax");
AddCodeLine ("tya");
/* The function result is an rvalue in the primary register */