- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there anyway to access the Nios program counter from the hardware (instead of using instruction like nextpc..) ? :confused:
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nice question, sorry I can not help you but I can suggest you to post your question to the Nios Forum.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I already posted the question there 2 months ago but seems no reply so far...:(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why do you need it? What will you do with it?
If you say accessing it? Is it access in software, or in hardware? Stefaan- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can only read it via the nextpc instruction.
From the NIOS II instruction set reference:
nextpc
get address of following instruction
Operation: rC ← PC + 4
Assembler Syntax: nextpc rC
Example: nextpc r6
Description: Stores the address of the next instruction to register rC.
Usage: A relocatable code fragment can use nextpc to calculate the address of its data
segment. nextpc is the only way to access the PC directly.
Exceptions: None
Instruction Type: R
Instruction Fields: C = Register index of operand rC
Obviously you can modify the program counter via jump and branch commands. Jake

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