Harshveer Singh
Harshveer Singh

Reputation: 4187

Gnu arm giving error on UBFX, Bad instruction

My arm assembly code is:

mov r1, #5
UBFX    r0, r1, #1, #1

When I try to compile it with arm-elf-gcc file.s It gives following error:

ass2_sample.s: Assembler messages:
ass2_sample.s:42: Error: bad instruction `ubfx r0,r1,#1,#1'

I am using GCC-3.4 toolchain. I can't understand where is the error.

Upvotes: 1

Views: 1933

Answers (1)

unwind
unwind

Reputation: 399753

What target are you compiling for? The documentation states:

These ARM instructions are available in ARMv6T2 and above.

These 32-bit Thumb instructions are available in ARMv6T2 and above.

There are no 16-bit Thumb versions of these instructions.

Upvotes: 3

Related Questions