You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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.
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!
The text was updated successfully, but these errors were encountered: