Skip to content
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

Added Popptr1 to save some bytes and ease parameter extraction #652

Merged
merged 6 commits into from
May 21, 2018

Conversation

IrgendwerA8
Copy link
Contributor

@IrgendwerA8 IrgendwerA8 commented May 20, 2018

Further savings are possible by exchange of assignments to ptr-variables like libsrc/cbm/rwcommon.s "ptr1<->ptr2" (but here you have to take care of dependent files).

@IrgendwerA8
Copy link
Contributor Author

Just noticed that there is may an issue with "strpbrk.s" (use of X-register). This leads to the question what happened to the function anyway: The description in the "funcref.sgml" is commented, there is no prototype to include and even the fastcall convention isn't applied.
Time to fix or remove?

@polluks
Copy link
Contributor

polluks commented May 20, 2018

Remove? This is ANSI!
Please add to string.h:
char* __fastcall__ strpbrk (const char* s1, const char* s2);
Warning: The implementation is broken!

@IrgendwerA8
Copy link
Contributor Author

IrgendwerA8 commented May 21, 2018

Reverted change on "strpbrk.s". Together with documentation update, calling convention change and prototype introduction this is a nice extra story.

sta ptr1 ; X
stx ptr1+1
rts
jmp popptr1 ; X
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the unintentionally added TABs again.

@oliverschmidt
Copy link
Contributor

Nice :-))

Together with documentation update, calling convention change and prototype introduction this is a nice extra story.

Full ACK.

@oliverschmidt oliverschmidt merged commit 81b3c16 into cc65:master May 21, 2018
@IrgendwerA8 IrgendwerA8 deleted the popptr1 branch May 21, 2018 14:04
@@ -13,7 +13,7 @@
FILEDES = 3 ; first free to use file descriptor

.importzp ptr1, ptr2, ptr3, tmp1
.import addysp, popax
.import addysp, popax, poptr1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: popptr1

@IrgendwerA8
Copy link
Contributor Author

IrgendwerA8 commented May 21, 2018

Sh... I have to hold back myself to mess around with foreign targets (wonder why there wasn't a build problem?).
Do you mind if I would fix this in my "Saved 6 bytes by using popptr1" pull request?

oliverschmidt added a commit that referenced this pull request Jul 26, 2018
@oliverschmidt
Copy link
Contributor

I have to hold back myself to mess around with foreign targets.

You might have a point here after all ;-)) ... see e949a3e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants