共有三种编码方式PUSH
拇指模式下的指令。第一个长度为 16 位,自 ARMv4T(原始 Thumb 实现)以来就存在:
15141312|11|109|8| 7..0 |
1 0 1 1| 0| 10|M| register_list|
Since register_list
是8位,只能压入寄存器R0
to R7
(and LR
, if M
位已设置)。
在 Thumb-2(ARMv6T2、ARMv7 及更高版本)中,添加了另外两种编码。它们都是 32 位长:
1514131211|109|876|5|4|3210||151413| 12 .. 0 |
1 1 1 0 1| 00|100|1|0|1101|| 0 M 0| register_list |
在这一篇中,register_list
是13位,所以可以推R0
to R12
and LR
.
我不会列出第三种编码,但它可以推送任何单个寄存器。
BTW, POP
编码非常相似。
16-bit POP
:
15141312|11|109|8| 7..0 |
1 0 1 1| 1| 10|P| register_list|
Can pop R0
to R7
and PC
(bit P
).
32-bit POP
多种的:
1514131211|109|876|5|4|3210||151413| 12 .. 0 |
1 1 1 0 1| 00|010|1|0|1101|| P M 0| register_list |
Can pop R0
to R12
, PC
(bit P
) and LR
(bit M
).