I am currently working with the TC275 tricore chip, and am exploring the startup code taken from the example on Hightec free tricore entry toolchain. I'm wondering about the effect of square brackets in assembly statements. As I worked with ARM core before, when square brackets are surrounded by a register, it means a reference to the value that the address of that register is storing.
But for Tricore, for example with LEA instruction: "lea %a14, [%a14]lo:__crt0_config
". This instruction means something like taking the low 16 bit value of the __crt0_config
function address plus the low 16 bit value available in register a14 and then assigning it to the low 16 bit in register a14.
I refer to the documentation in the userguide of Hightec free tricore entry toolchain and it says:
Indirection: If an operand (register or constant) is used to access memory indirectly, you may, at your option, wrap it in square brackets (e.g. [r4]
). This is completely in compliance with the specification mentioned above; however, there are no options which let you specify if the use of such indirection specifiers (read: square brackets) is illegal, optional, or mandatory. This means you can’t change the default, which is ”optional”. Of course, if you use indirection specifiers at places where they’re not allowed, you’ll get an error message, which again is compliant with the Assembler Mnemonics Specification.
In addition to the lea instruction, there are also ld.w
and st.w
instruction that also use square brackets (but the mov
command does not). I think this is related to addressing mode.
Please help me understand the problem.
Thanks!!!