| |||
| Home > Compiler-specific Features > Instruction intrinsics > __cdp intrinsic | |||
This intrinsic inserts a CDP or CDP2 instruction
into the instruction stream generated by the compiler. It enables
you to include coprocessor data operations in your C or C++ code.
This intrinsic is intended for specialist expert use only.
__cdp(unsigned intcoproc, unsigned intops, unsigned intregs)
Where:
coprocIdentifies the coprocessor the instruction is for.
must
be an integer in the range 0 to 15.coproc
opsIs an encoding of two opcodes where:
the first opcode is a 4-bit coprocessor-specific opcode
the second opcode is an optional 3-bit coprocessor-specific opcode.
Add 0x100 to to
generate a opsCDP2 instruction.
regsIs an encoding of the coprocessor registers.
The use of these instructions depends on the coprocessor. See your coprocessor documentation for more information.
void copro_example()
{
const unsigned int ops = 0xA3; // opcode1 = A, opcode2 = 3
const unsigned int regs = 0xCDE; // reg1 = C, reg2 = D, reg3 = E
__cdp(4,ops,regs); // coprocessor number 4
}
CDP and CDP2 in the Assembler Reference.