当前位置:网站首页>ARM指令集之Load/Store访存指令(二)
ARM指令集之Load/Store访存指令(二)
2022-06-12 11:37:00 【fanxiaoyu321】
这篇笔记记录了第二类Load/Store指令,即操作数为16位半字和有符号字节数据的Load/Store指令。
| 助记符 | 说明 |
|---|---|
| LDRH | 半字数据读取指令 |
| STRH | 半字数据写入指令 |
| LDRSB | 有符号字节数据读取指令 |
| LDRSH | 有符号半字数据读取指令 |
寻址方式
这类指令拥有一致的寻址方式,具体介绍见这里。
| 语法 | 说明 | |
|---|---|---|
| 1 | [<Rn>, #+/-<offset_8>] | 立即数偏移量寻址 |
| 2 | [<Rn>, +/-<Rm>] | 寄存器偏移量寻址 |
| 3 | [<Rn>, #+/-<offset_8>]! | 立即数事先更新寻址 |
| 4 | [<Rn>, #+/-<Rm>]! | 寄存器事先更新寻址 |
| 5 | [<Rn>], #+/-<offset_8> | 立即数事后更新寻址 |
| 6 | [<Rn>], +/- | 寄存器事后更新寻址 |
LDRH(半字数据读取指令)
LDR{<cond>}H <Rd>, <address_mode>
if CondPassed(cond) then
if address[0] == 0 then
data = Mem[address, 2]
else
data = 未知
Rd = data
可见,该指令要求地址必须是半字对齐的。
STRH(半字数据写入指令)
STR{<cond>}H <Rd>, <address_mode>
if CondPassed(cond) then
if address[0] == 0 then
data = Rd[15:0]
else
data = 未知
Mem[address, 2] = data
同样,该指令要求地址必须是半字对齐的。
LDRSB(有符号字节数据读取指令)
LDRSB从内存中读取一个字节数据保存在目标寄存器的低8位,然后按照符号位填充目标寄存器的高24位,如此生成最后的32位数。
LDR{cond}SB <Rd>, <address_mode>
if CondPassed(cond) then
data = Mem[address, 1]
Rd = SignExtend(data)
LDRSH(有符号半字数据读取指令)
LDRSH从内存中读取一个半字数据保存在目标寄存器的低16位,然后按照符号位填充目标寄存器的高16位,如此生成最后的32位数。
LDR{<cond>}SH <Rd>, <address_mode>
if CondPassed(cond) then
if address[0] == 0 then
data = Mem[address, 2]
else
data = 未知
Rd = SignExtend(data)
同样,该指令要求地址必须是半字对齐的。
边栏推荐
- Sendmail dovecot mail server
- AcWing 1995. Meet and greet (simulation)
- K58. Chapter 1 installing kubernetes V1.23 based on kubeadm -- cluster deployment
- SharDingJDBC-5.1.0按月水平分表+读写分离,自动创表、自动刷新节点表
- go基于阿里云实现发送短信
- MySQL lock leak detection and defect filling
- Shardingjdbc-5.1.0 monthly horizontal table splitting + read-write separation, automatic table creation and node table refresh
- 人類想要擁有金錢、權力、美麗、永生、幸福……但海龜只想做一只海龜
- Lambda expression | shallow solution
- 字节序 - 如何判断大端小端
猜你喜欢

21 reasons why you need social media QR code

Doris记录服务接口调用情况

manuscript手稿格式准备

Using stairs function in MATLAB

Logrotate log rotation method create and copyruncate principles

QT based travel query and simulation system

【clickhouse专栏】基础数据类型说明

Humans want to have money, power, beauty, eternal life and happiness... But turtles only want to be a turtle

Clickhouse column basic data type description

【clickhouse专栏】基础数据类型说明
随机推荐
Golang基础(7)
UI自动化测试中比较少见的异常记录
Verifiability and scarcity of NFT Digital Collections
C# 37. Textbox scroll bar and multiline
【clickhouse专栏】基础数据类型说明
One must keep writing, so as not to be submerged by the vast crowd.
Mysql45 lecture 01 | infrastructure: how is an SQL query executed?
Doris记录服务接口调用情况
Redis summary
Unity 连接 Microsoft SQLSERVER 数据库
Signal relay rxsf1-rk271018dc110v
6.6 分离卷积
Manuscript manuscript format preparation
Network topology
Socket programming UDP
Blue Bridge Cup 2015 CA provincial competition (filling the pit)
K53. Chapter 2 installing kubernetes v1.22 based on binary packages -- cluster deployment
Relation entre les classes et à l'intérieur des classes de classification vidéo - - Régularisation
M-arch (fanwai 10) gd32l233 evaluation -spi drive DS1302
AcWing 1921. Rearranging cows (ring diagram)