Hi all,
Iam using some Assembly instructions for my application where iam using LDR instrcution and RBIT (reverse bit) instruction.
these are not compiling when i use code generation tools latest version 4.6.1 and all other instructions are fine, if any one had idea of these instructions uasege please suggest me how to use.......?
ERROR : giving illegal mnemonic.
for LDR when i load direct constant value it is giving problem..
ex : LDR r0, =#0x1000.
Thanks in Advance,
Vinay.
Can you try without the "="? For example...
LDR r0, #0x1000
For more information checkout the Assembler User Guide found in:
C:\Program Files\Texas Instruments\ccsv4\tools\compiler\tms470\docs\SPNU118G.pdf
Yes, I tried to use with LDR r0, #0x1000
but it is giving error again. another problem is with RBIT instruction.
when i use RBIT r7,r8. giving error illegal mnemonic.
as in some documents it said that RBIT instruction is not available in armv6 and above.
but it is working when i compile with rvds3.0 setting armv7a option.
can any one suggest me to use this instruction in CCSv4?
Thanks,
Are you using the -mv7A8 compiler switch to tell the compiler that you're using a Cortex A8?
---------------------------------------------------------------------------------------------------------
Please click the Verify Answer button on this post if it answers your question.---------------------------------------------------------------------------------------------------------
yes, iam using -mv7a8 compiler switch.
Similar problem here.
I am trying following lines in the assembler
RBIT R2, R0 ; R2 := reversed low 32 bits of input = high 32 bits of result. RBIT R3, R1 ; R3 := reversed high 32 bits of input = low 32 bits of result.
My toolchain is 4.6.5
Compiler output
"C:\Program Files\Texas Instruments\TMS470 Code Generation Tools 4.6.5\bin\cl470.exe" -q -g -s -mv7R4 -al --elf -me -mv7R4 --abi=eabi --code_state=32 C:\arkady\work\wl9_base\firmware\asm_utils.asm 2 Assembly Errors, No Assembly Warnings"C:\arkady\work\wl9_base\firmware\asm_utils.asm", ERROR! at line 153: [E0002] Illegal mnemonic specified RBIT R2, R0 ; R2 := reversed low 32 bits of input = high 32 bits of result."C:\arkady\work\wl9_base\firmware\asm_utils.asm", ERROR! at line 154: [E0002] Illegal mnemonic specified RBIT R3, R1 ; R3 := reversed high 32 bits of input = low 32 bits of result.
Thank you, Arkady
Anyone? Is it a bug in the toolchain or there is another mnemonic for RBIT? Should I use machine code as a workaround?
RBIT is a Thumb2 instruction. Did you use a .thumb directive in your assembly code?
.thumb did the trick
Thank you.
Hi Brad Griffis & Arkady Miasnikov,
I have the code with both RBIT instructions and CortexA8 instructions (i.e., thumb2 instruction and cortexA8 instructions).
I followed with .thumb directly in the code it is giving errors with the arm instructions.
ex: .thumb
RBIT R2, R3 ----> now it does not have any error
BNE next ----> but this instruction is getting error with .thumb directive
so can any one give me the example of code to write both cortexa8 instructions and thumb2 instructions in single function of code.
2. can i use .arm assembler directive in cortexa8 device to work below lines of code in single function.
Vinay
You cannot switch instruction sets on an instruction-by-instruction basis. For a given function you must write the entire thing in ARM instruction set or Thumb instruction set.