using extended thumb instruction in assembly on S32K146

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

using extended thumb instruction in assembly on S32K146

跳至解决方案
1,725 次查看
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?

标签 (1)
0 项奖励
回复
1 解答
1,705 次查看
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 项奖励
回复
1 回复
1,706 次查看
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 项奖励
回复