Timeline for strlen and strcmp implementation in x86 FASM assembly
Current License: CC BY-SA 4.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 22, 2019 at 19:17 | comment | added | Peter Cordes |
@DeBos99: After you find a stopping place (end or difference), you can sign-extend the chars and subtract one from the other to get a + / 0 / - result. That removes the need for 3-way branching. Even if you didn't do that, you only need two jcc along any given path if you lay out your branches carefully. This answer unfortunately doesn't say anything about simplifying the branching, or the inefficiency of writing DL and DH on CPUs other than mainstream Intel (false dependency if DH isn't renamed separately from DL or at least from the rest of EDX)
|
|
Jan 1, 2019 at 19:11 | comment | added | DeBos | I think you are right. I'll just swap 1 and -1 and it should be good now. | |
Jan 1, 2019 at 19:07 | history | answered | Gnik | CC BY-SA 4.0 |