Page 1 of 1
SETD wanted
Posted: Tue May 04, 2010 10:44 pm
by skoe
Hi all,
When I use the mnemonic SETD in a foobar.S file, I get:
Code: Select all
Error: no format matching for instruction 'setd'
the line in question is:
What's wrong?
Edit: Problem solved with the help from the guys on IRC:
It's also written in xas99.pdf, but I've read the architecture manual only.
Re: SETD wanted
Posted: Tue May 04, 2010 10:52 pm
by lilltroll
I just have to show first time I can answer an asm quest :shock: :D
Its setd res[r1],r0
Re: SETD wanted
Posted: Sat May 08, 2010 1:25 pm
by JohnR
Hi,
Maybe in the next documentation release, there could be an addition to section 19.2 Inline Assembly of the Tools User Guide that directs the reader to Section 8 XCore XS1 Instructions of the XS1 Assembly Language manual. And explain the use of the various forms of 'pointer', rs, dp, sp.
For instance what would be the corresponding 'inline asm' instruction for 'ldwp, d, dp[u16]'. I would guess -
asm (" ldwp %0, %dp[address]" : "=r"( result ) : "r"(address));
but I don't really know.
John.
Re: SETD wanted
Posted: Mon May 10, 2010 10:37 am
by larry
u16 is in this case an immediate. In the C compiler, we follow standard GCC rules, see for example
http://www.ibiblio.org/gferg/ldp/GCC-In ... HOWTO.html
In the XC compiler, immediates are not yet implemented (and must be hardcoded in the format string). They are high on the list of improvements to the XC compiler for future tools releases.
I believe you meant
ldaw rather than
ldwp. That would be:
Code: Select all
asm("ldaw %0, dp[%1]" : "=r"(result) : "i"(address))
Syntax is listed in the Assembly Language Manual.