I don't see a way to do this, but I'll ask:
Is there a way to pass arguments to inline assembly statements, ala gcc? If so, how?
Thanks,
Matt
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I don't see a way to do this, but I'll ask:
Is there a way to pass arguments to inline assembly statements, ala gcc? If so, how?
Thanks,
Matt
No. But consider using intrinsics instead. Intrinsics act like function calls, but are (with a few exceptions) implemented with a single instruction.
Thanks and regards,
-George
This seems like an odd reply, since it is unstated that the function I wish to implement is one that's already defined. I wish to read a co-processor register in C, and put it somewhere, like gcc would allow me to do.
The usual method in TI C code is with a cregister, reading a memory-mapped location, or using an assembly code helper function
On C6x, to read the CSR register, you could do:
#include <c6x.h>
unsigned int csr_val = CSR;
However, the names of coprocessor registers aren't usually built in to the compiler and assembler. How would you have named this coprocessor register if you could have used gcc-style inline assembly? Is there a built-in name for it already, or would you have used its address?
Suppose it's memory mapped:
#define LOCATION 0x12345678
unsigned int value = *((volatile unsigned int *)LOCATION);
Obviously calling an assembly code helper function has the call/return overhead