Hello,
I'm diving slowly in ASM programming for XMOS and I have something I don't really understand.
While I understant the usage of Constants Pool(s) (on other architectures), I don't understand really on XMOS where constant pools are used and how?
Understand me, I understand the instructions targeted at loading constants from constant pools, but I don't understand how and when they are used (by the compiler mainly). (I can't find documentation on that, I looked everywhere in the xs1 arch book).
Constant Pool usage
-
- XCore Addict
- Posts: 228
- Joined: Thu Jan 27, 2011 3:30 pm
- Location: Argenteuil - France
-
- Experienced Member
- Posts: 99
- Joined: Mon Dec 14, 2009 1:01 pm
From the tools developer guide:
This includes any constants too large for immediates and string values. You can also branch and link through the constant pool (BLACP).Named global read-only objects are placed in the .cp.rodata section and accessed
via the cp register.
-
- XCore Addict
- Posts: 228
- Joined: Thu Jan 27, 2011 3:30 pm
- Location: Argenteuil - France
Thanks Jamie,
I forgot this one ... forgot to check the Tools dev guide :oops:
I forgot this one ... forgot to check the Tools dev guide :oops:
-
- XCore Expert
- Posts: 844
- Joined: Sun Jul 11, 2010 1:31 am
Since this is the ASM forum...
It is called "constant pointer", but you can of course write to what it points to
just fine (if it points to RAM, heh). So you can use it as a pointer to whatever
you please; just remember that there are no instructions to write with CP as
base address, you have to do an LDWACP first, so you would typically use it
for something that you do not need to write to often (but not necessarily
never!)
It is called "constant pointer", but you can of course write to what it points to
just fine (if it points to RAM, heh). So you can use it as a pointer to whatever
you please; just remember that there are no instructions to write with CP as
base address, you have to do an LDWACP first, so you would typically use it
for something that you do not need to write to often (but not necessarily
never!)