-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String op improvements #141
base: master-64tass
Are you sure you want to change the base?
Conversation
cmp #AscSP | ||
bne _done | ||
; Move back to point at last character | ||
jsr w_one_minus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this inline slows down the loop; could undo
; While spaces are found, | ||
; decrease the count on the data stack and repeat | ||
lda (0,x) | ||
jsr is_whitespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this also slows it down, but seems better than just cmp #' ' unless that was intentionally avoiding other whitespace?
One of the differences is that |
ah, that makes sense. so I'll switch -TRAILING back to only check for spaces. Does it make sense for -LEADING to behave in a similar same (only strip spaces specifcally) or should it continue to strip other whitespace as well? |
I agree that |
Saves about 50 bytes overall. Simplifies CLEAVE (faster, smaller and avoids input manipulation). Shortens -LEADING/TRAILING: this slows it down a little after removing some inlining, but also because I switched to the shared
jsr is_whitespace
instead of the specificcmp #AscSP
. I'm not sure if that was intentional but seemed like it should be symmetric with LEADING and CLEAVE?The overall test cycles increase somewhat because -TRAILING is used in various tests, but I imagine in practice the CLEAVE improvement might be more important? Equally I could just undo the -TRAILING changes.
Cycle counts with simple test:
*337 with
cmp #AscSp
instead ofjsr is_whitespace
.