Jun 15, 2020
01:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 15, 2020
01:59 AM
Hello
I am having trouble reading the A11 Register.
I tried:
But none seem to work. Can someone please help me?
Thank you very much.
I am having trouble reading the A11 Register.
I tried:
__mfcr(CPU_A11)
(&CPU0_A11)->B.ADDR
*((unsigned int *)&CPU0_A11)
//Also Tried with inline assembly
int *res;
__asm__ volatile ("mov.aa %0, %%a11": "=a" (res) : :"a11");
return res;
But none seem to work. Can someone please help me?
Thank you very much.
8 Replies
Jun 15, 2020
05:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 15, 2020
05:43 AM
This didn't work?
What value did you get? What were you expecting?
int res;
res = __mfcr( CPU_A11 );
What value did you get? What were you expecting?
Jun 15, 2020
05:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 15, 2020
05:51 AM
UC_wrangler wrote:
This didn't work?
int res;
res = __mfcr( CPU_A11 );
What value did you get? What were you expecting?
I get 0
I was expecting to get the address located in a11, but the mnemonic places 0 into d15, instead of the expected address.
I noticed from reading the documentation that __mfcr is only intended for CSFR Registers. Could this be why it doesn't work for General Purpose ones?
Jun 15, 2020
09:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 15, 2020
09:24 AM
I think you're right about __mfcr and general registers - coffee hasn't kicked in yet :).
How about this:
How about this:
register int res asm("d0");
__asm__ ("mov.d %d0, %a11" );
Jun 15, 2020
09:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 15, 2020
09:46 AM
UC_wrangler wrote:
I think you're right about __mfcr and general registers - coffee hasn't kicked in yet :).
How about this:
register int res asm("d0");
__asm__ ("mov.d %d0, %a11" );
I may also be making a silly mistake, but doing this gives me
syntax error - token ";" inserted before "asm"
Is there something I have to import for this to work properly?
Thought maybe a "=" was missing but that just gives me linker errors
Jun 15, 2020
09:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 15, 2020
09:56 AM
Sorry - which compiler are you using here? The one I posted was gcc (Hightec) syntax.
Jun 15, 2020
09:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 15, 2020
09:57 AM
UC_wrangler wrote:
Sorry - which compiler are you using here? The one I posted was gcc (Hightec) syntax.
Tasking 🙂
Jun 15, 2020
11:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 15, 2020
11:10 AM
And here I went to all the work of installing GCC just to answer 😛
In Tasking, it's:
In Tasking, it's:
volatile int res;
__asm( "mov.d %0,a11" : "=d"(res) );
Jun 16, 2020
01:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 16, 2020
01:55 AM
UC_wrangler wrote:
And here I went to all the work of installing GCC just to answer 😛
In Tasking, it's:
volatile int res;
__asm( "mov.d %0,a11" : "=d"(res) );
This works. Thank you! 😄
This widget could not be displayed.