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

Purpose and preservation of registers #73

Open
Triang3l opened this issue Sep 8, 2012 · 3 comments
Open

Purpose and preservation of registers #73

Triang3l opened this issue Sep 8, 2012 · 3 comments

Comments

@Triang3l
Copy link

Triang3l commented Sep 8, 2012

Since we don't have a convention on register usage, how about making one, like for x86?

A convention on register naming would make writing libraries and creating calling conventions easier.

What do I propose:

  • A - no proposal.
  • B - base pointer - stores SP before allocating variables.
  • C - counter - counter - used in loops.
  • I and J - used for copying memory.
  • X and Y - expression operands registers.
  • Z - return value.

B is always pushed when calling a subroutine. Other registers (except for Z) are preserved if needed.

@Yamakaky
Copy link

Yamakaky commented Sep 8, 2012

I think we can use the A register for the return value

@Triang3l
Copy link
Author

Triang3l commented Sep 8, 2012

Why not Z? Z is the last Latin letter, symbolizes end of a function. A looks more general-purpose.

@hach-que
Copy link
Member

hach-que commented Sep 9, 2012

There is already a register convention in the coding style guide line. I
don't see why we would need to be more strict in this area.

On Sunday, September 9, 2012, SiPlus notifications@github.com wrote:

Why not Z? Z is the last English letter, symbolizes end of a function.


Reply to this email directly or view it on GitHub.

Regards, James Rhodes.
Redpoint Software

http://about.me/james.rhodes

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

No branches or pull requests

3 participants