- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi guys,
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!!!
Solved! Go to Solution.
- Labels:
-
AURIX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It might be better to look at TriCore Architecture Manual volume 2, which describes every instruction. In this case, it says for this form of LEA:
EA = A[b] + sign_ext(off16);
A[a] = EA[31:0];
In other words: set A14 to the lower 16 bits of crt0_config's address plus A14.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It might be better to look at TriCore Architecture Manual volume 2, which describes every instruction. In this case, it says for this form of LEA:
EA = A[b] + sign_ext(off16);
A[a] = EA[31:0];
In other words: set A14 to the lower 16 bits of crt0_config's address plus A14.