ARM base instruction -- bfm

If <imms> is greater than or equal to <immr>, this copies a bitfield of (<imms>-<immr>+1) bits starting from bit position <immr> in the source register to the least significant bits of the destination register.

If <imms> is less than <immr>, this copies a bitfield of (<imms>+1) bits from the least significant bits of the source register to bit position (regsize-<immr>) of the destination register, where regsize is the destination register size of 32 or 64 bits.

In both cases the other bits of the destination register remain unchanged.

Bitfield Move 通常通过其别名之一访问,这些别名在反汇编时总是首选。

如果<imms>大于或等于<immr>,则会从源寄存器中的位位置<immmr>开始复制一个(<imms>-<immr>+1)位的位字段到目标寄存器的最低有效位。

如果<imms>小于<immr>,则会将(<imms>+1)位的位字段从源寄存器的最低有效位复制到目标寄存器的位位置(regsize-<immr>),其中regsize是32或64位的目标寄存器大小。

在这两种情况下,目标寄存器的其他位保持不变。

32-bit variant

Applies when sf == 0 && N == 0.

BFM <Wd>, <Wn>, #<immr>, #<imms>

64-bit variant

Applies when sf == 1 && N == 1.

BFM <Xd>, <Xn>, #<immr>, #<imms>

Decode for all variants of this encoding

integer d = UInt(Rd);

integer n = UInt(Rn);

integer datasize = if sf == '1' then 64 else 32;

integer R;

bits(datasize) wmask;

bits(datasize) tmask;

if sf == '1' && N != '1' then UNDEFINED;

if sf == '0' && (N != '0' || immr<5> != '0' || imms<5> != '0') then UNDEFINED;

R = UInt(immr);

(wmask, tmask) = DecodeBitMasks(N, imms, immr, FALSE);

integer UInt(bits(N) x)

result = 0;

for i = 0 to N-1

if x<i> == '1' then result = result + 2^i;

return result;

Operation

bits(datasize) dst = X[d];

bits(datasize) src = X[n];

// perform bitfield move on low bits

bits(datasize) bot = (dst AND NOT(wmask)) OR (ROR(src, R) AND wmask);

// combine extension bits and result bits

X[d] = (dst AND NOT(tmask)) OR (bot AND tmask);

相关推荐
white-persist20 小时前
【攻防世界】reverse | re1-100 详细题解 WP
c语言·开发语言·网络·汇编·python·算法·网络安全
sulikey1 天前
如何使用 Visual Studio 代替 OllyDbg 完成汇编语言实验
汇编·ide·debug·visual studio·ollydbg
浩浩测试一下2 天前
C&&汇编中的调用约定
大数据·汇编·安全·web安全·网络安全·系统安全
猫猫的小茶馆2 天前
【ARM】BootLoader(Uboot)介绍
linux·汇编·arm开发·单片机·嵌入式硬件·mcu·架构
white-persist2 天前
【攻防世界】reverse | answer_to_everything 详细题解 WP
c语言·开发语言·汇编·python·算法·网络安全·everything
猫猫的小茶馆2 天前
【ARM】eclipse 中创建汇编工程
c语言·汇编·arm开发·stm32·单片机·嵌入式硬件·eclipse
white-persist3 天前
【攻防世界】reverse | Mysterious 详细题解 WP
c语言·开发语言·网络·汇编·c++·python·安全
欧恩意3 天前
【Viusal Studio】关于增量链接机制
汇编·windows·bug
资料,小偿4 天前
4.23.1基于8086的电子琴,8086的电子音调系统,8253的OUT0作为扬声器输出口
汇编·proteus
♛识尔如昼♛4 天前
计算机组成原理(17) 第三章 - 常用的X86 汇编指令
汇编