SETD wanted

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
User avatar
skoe
Experienced Member
Posts: 94
Joined: Tue Apr 27, 2010 10:55 pm
Contact:

SETD wanted

Post 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:

Code: Select all

setd r1, r0
What's wrong?

Edit: Problem solved with the help from the guys on IRC:

Code: Select all

setd res[r1], r0
It's also written in xas99.pdf, but I've read the architecture manual only.
Last edited by skoe on Tue May 04, 2010 10:55 pm, edited 1 time in total.


User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

I just have to show first time I can answer an asm quest :shock: :D

Its setd res[r1],r0
Probably not the most confused programmer anymore on the XCORE forum.
JohnR
Experienced Member
Posts: 93
Joined: Fri Dec 11, 2009 1:39 pm

Post 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.
User avatar
larry
Respected Member
Posts: 275
Joined: Fri Mar 12, 2010 6:03 pm

Post 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.
Post Reply