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?
Solved! Go to Solution.
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
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