- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i have some questions about registers in nios2
1: the GP(r26)' function like PC as in X86 architecture ? 2: (r15-r8) is named Caller-Saved registers ,their function ? 3:(r16_r23),their function ? 4: when call a function, the rule of saving registers is what? between r2 to r25 ,which should be saved ? 5: when an interrupt happen or call function , the differences between the saving registers and restore register action.Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi wkongwkong,
Please see the "Nios II Processor Reference Handbook": http://www.altera.com/literature/lit-nio2.jsp (http://www.altera.com/literature/lit-nio2.jsp) Regards, --Scott- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by wkongwkong@Jun 22 2006, 11:15 PM i have some questions about registers in nios2
1: the gp(r26)' function like pc as in x86 architecture ?
2: (r15-r8) is named caller-saved registers ,their function ?
3:(r16_r23),their function ?
4: when call a function, the rule of saving registers is what? between r2 to
r25 ,which should be saved ?
5: when an interrupt happen or call function , the differences between the saving registers and restore register action.
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=16354)
--- quote end ---
--- Quote End --- 1. I'm rusty on my x86 so I'm not sure of the answer to this. 2. Caller saved registers have to be saved by the calling function. So if you're writing in assembler you don't have to bother saving them. 3. They're just registers that you can do with what you will 4. When calling a function if doing it from assembler you should save the caller saved registers. If you do the call from C the compiler looks after this for you. 5. If you want to know which registers are saved for an IRQ look in the file alt_exception_entry.S in the nios2 component

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page