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

It would be a great help for beginners to have common code snippets #6

Closed
scotws opened this issue Mar 2, 2018 · 1 comment
Closed

Comments

@scotws
Copy link
Contributor

scotws commented Mar 2, 2018

I'm just starting to look at RISC-V assembler programming (as a hobby, I do 6502/65816 stuff), and though it is easy to find lists of registers, explanations of what they do, what seems to be sorely missing are code snippets for common tasks -- say, simple loops, nested loops, jump tables, how to set up a stack when there is no hardware stack, how to copy a region of memory to another region of memory.

Since these common constructs (maybe "idioms" is a better word) are used over and over again, having them written down with detailed explanations would jump-start coding so people don't have to invent the, er, loop all over again. I'm also sure there are some sneaky tricks people don't think of at first; there usually are in assembler programming.

Also, just out of curiosity, is there any reason this is being written in markup and not as a wiki?

Thanks!

@palmer-dabbelt
Copy link
Contributor

I think the RISC-V reader might have some of these, and while it might be appropriate as an appendix here it's not really the focus of the document -- this is meant to be longer-form assembler documentation as opposed to a RISC-V tutorial.

There's really no reason this is written in markdown, it's just the simplest thing to make appear on github.

I'm going to close this, but if you want to start an appendix (or even another file in this directory) with examples (or even a list of examples you'd like) then feel free to open a pull request.

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

2 participants