Hi Karl,
These constants allow the C compiler to produce more efficient code. Of course you can also use them in assembly programs by explicitly using lbco/sbco instructions.
Let me give you an example how pru-gcc uses the constant table. Consider this C code snippet:
# define MYREG ( * (volatile uint32_t *)(0x4802A000 + 0x24))
MYREG = 42;
Normally pru-gcc would output the following:
ldi r14, %lo(1208131620)
ldi r14.w2, %hi_rlz(1208131620)
ldi r15, 42
sbbo r15, r14, 0, 4
But you can tell the compiler that this address base is special (btw, already defined for you in <pru/io.h>):
#pragma ctable_entry 2 0x4802a000
Then the compiler can produce a much shorter instruction sequence:
ldi r14, 42
sbco r14, 2, 36, 4
TI's compiler uses a different syntax for the constants declarations, but essentially does the same optimization.
Regards,
Dimitar