arm64汇编学习- (4)比较跳转指令1

本文详细介绍了ARM64架构中用于比较和跳转的汇编指令,包括CMP和CMN系列(如CMP(extendedregister),CMP(immediate)等),它们更新条件标志并丢弃结果。同时讲解了条件选择指令如csel,CSET和CSINC的工作原理,并提供了测试代码示例来帮助理解这些指令的使用和效果。


本篇博客是基于对苯叔的第三季视频的学习整理而得,大家如果想深入学习可以购买《arm64体系结构编程与实践》以及购买苯叔出品的第三季视频。

1 比较指令

1.1 CMP (extended register)

Compare (extended register) subtracts a sign or zero-extended register value, followed by an optional left shift amount, from a register value. The argument that is extended from the register can be a byte, halfword, word, or doubleword. It updates the condition flags based on the result, and discards the result.
This instruction is an alias of the SUBS (extended register) instruction. This means that:
• The encodings in this description are named to match the encodings of SUBS (extended register).
• The description of SUBS (extended register) gives the operational pseudocode for this instruction.
在这里插入图片描述

1.2 CMP (immediate)

Compare (immediate) subtracts an optionally-shifted immediate value from a register value. It updates the condition flags based on the result, and discards the result.
This instruction is an alias of the SUBS (immediate) instruction. This means that:
• The encodings in this description are named to match the encodings of SUBS (immediate).
• The description of SUBS (immediate) gives the operational pseudocode for this instruction.
在这里插入图片描述

1.3 CMP (shifted register)

Compare (shifted register) subtracts an optionally-shifted register value from a register value. It updates the condition flags based on the result, and discards the result.
This instruction is an alias of the SUBS (shifted register) instruction. This means that:
• The encodings in this description are named to match the encodings of SUBS (shifted register).
• The description of SUBS (shifted register) gives the operational pseudocode fo

评论 10
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值