using extended thumb instruction in assembly on S32K146

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

using extended thumb instruction in assembly on S32K146

Jump to solution
745 Views
KelvinSmith
Contributor III

I have been optimizing some code on the S32K146 processor, converting some of it to assembly language. I am seeing that the C code uses instructions that the assembler won't allow, including:

cmn r0,#1

ldrsh r0,[r1]

push {r4-r11,lr}

All three of these are 4 byte instructions, as seen in the disassembly, so they are some kind of extended thumb instructions. (I haven't found any documentation on them.) The assembler gives various errors when it encounters them. The first two I can work around, but the push instruction is kind of necessary. (The push instruction will only allow registers up to r7, as it is). Does anyone know how to enable these?

Labels (1)
0 Kudos
1 Solution
725 Views
KelvinSmith
Contributor III

I did a bunch of searching and found that these are called the thumb-2 instructions and they can be enabled by putting this at the top of the source file:

.syntax unified

View solution in original post

0 Kudos
1 Reply
726 Views
KelvinSmith
Contributor III

I did a bunch of searching and found that these are called the thumb-2 instructions and they can be enabled by putting this at the top of the source file:

.syntax unified

0 Kudos