ARM64 registers

参考文档:《ARM Cortex-A Series Programmer's Guide for ARMv8-A》

 

一、通用寄存器

1、arm64一共有31个通用寄存器,X0~X30

                                        

其中X29,又称FP寄存器,而X30,又称LR寄存器

每一个通用寄存器都有两种表示:Xn 和 Wn,其中Xn代表64bit,Wn代表低32bit,因此读Wn,相当于读Xn的低32bit值,写Wn,相当于将其进行零扩展至64bit,然后再写到Xn中

二、特殊寄存器

1、零寄存器

分为XZR(64bit)/ WZR(32bit),当读该寄存器时,返回全0,注意:写寄存器操作被忽略

2、PC寄存器

3、SP寄存器

分为SP(64bit)/ WSP(32bit) 

每种Exception level都有自己的SP寄存器,而且总是根据target Exception level来选择,比如,有一个往EL1跳变的异常时,选择SP_EL1寄存器。

4、SPSR寄存器

Saved Processor State Register ,顾名思义,用来保存CPU状态的寄存器

如果在一个往EL1跳变的异常时,则选择SPSR_EL1来保存当前CPU状态

5、PSTATE

当执行ERET指令,从一个异常返回时,将SPSR_ELn赋值给PSTATE,以恢复发生异常前的CPU state

                                              

其中N,Z,C,V可以在EL0级别进行访问,其他的都需要在EL1或者更高,或者EL0(UNDEFINED),才可以被执行

6、ELR寄存器

Exception Link Register,顾名思义,用来保存从异常返回的地址

 

三、System registers

稍后补充

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This book is intended to be used in a first course in assembly language programming for Computer Science (CS) and Computer Engineering (CE) students. It is assumed that students using this book have already taken courses in programming and data structures, and are competent programmers in at least one high-level language. Many of the code examples in the book are written in C, with an assembly implementation following. The assembly examples can stand on their own, but students who are familiar with C, C++, or Java should find the C examples helpful. Computer Science and Computer Engineering are very large fields. It is impossible to cover everything that a student may eventually need to know. There are a limited number of course hours available, so educators must strive to deliver degree programs that make a compromise between the number of concepts and skills that the students learn and the depth at which they learn those concepts and skills. Obviously, with these competing goals it is difficult to reach consensus on exactly what courses should be included in a CS or CE curriculum. Traditionally, assembly language courses have consisted of a mechanistic learning of a set of instructions, registers, and syntax. Partially because of this approach, over the years, assembly language courses have been marginalized in, or removed altogether from, many CS and CE curricula. The author feels that this is unfortunate, because a solid understanding of assembly language leads to better understanding of higher-level languages, compilers, interpreters, architecture, operating systems, and other important CS an CE concepts. One of the goals of this book is to make a course in assembly language more valuable by introducing methods (and a bit of theory) that are not covered in any other CS or CE courses, while using assembly language to implement the methods. In this way, the course in assembly language goes far beyond the traditional assembly language course, and can once again pl
SimIt-ARM-3.0 给予命令行ARM指令模拟器,短小精悍,是研究ARM处理器的好工具,该模拟器既可以运行用户级别的ELF程序,又可以模拟运行Linux操作系统;提供了简单易用的调试命令,可以逐条跟踪指令的执行。 SimIt-ARM-3.0-gk-20150902.tar.bz2 HowTo 0.what is SimIt-ARM-3.0 SimIt-ARM 3.0 is an instruction-set simulator that runs both system-level and user-level ARM programs, for more about it please read user's guide file. 1.how to build tar jxvf SimIt-ARM-3.0-gk-20150902.tar.bz2 cd SimIt-ARM-3.0-gk ./configure make make install After these steps, the ./build/bindirectory contains the following programs: ema An ARM interpreter. To test the installation was successful type ./build/bin/ema test/wc configure modifiy PATH environment variable: PATH=$PATH:$HOME/SimIt-ARM-3.0-gk/build/bin ; export PATH 2. how to use 2.1 run user-level ARM programs [root@ORA9 SimIt-ARM-3.0-gk]# cd gcc-asm [root@ORA9 gcc-asm]# more hello.c /* * hello.c * Tue Sep 8 10:13:40 CST 2015 */ int main() { printf("hello world\n"); __asm("mov r0,#2\n\t" "swi 0x1\n\t"); // syscall: exit(2); } [root@ORA9 gcc-asm]# arm-linux-gcc -v Reading specs from /usr/local/arm/3.4.1/bin/../lib/gcc/arm-linux/3.4.1/specs Configured with: /opt/crosstool/crosstool-0.28/build/arm-linux/gcc-3.4.1-glibc-2.3.2/gcc-3.4.1/configure --target=arm-linux --host=i686-host_pc-linux-gnu --prefix=/opt/crosstool/arm-linux/gcc-3.4.1-glibc-2.3.2 --with-float=soft --with-headers=/opt/crosstool/arm-linux/gcc-3.4.1-glibc-2.3.2/arm-linux/include --with-local-prefix=/opt/crosstool/arm-linux/gcc-3.4.1-glibc-2.3.2/arm-linux --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long Thread model: posix gcc version 3.4.1 [root@ORA9 gcc-asm]# arm-linux-gcc hello.c -o hello -static [root@ORA9 gcc-asm]# ls -l hello* -rwxr-xr-x 1 root root 520775 Sep 8 10:18 hello -rw-r--r-- 1 root root 160 Sep 8 10:15 hello.c [root@ORA9 gcc-asm]# file hello hello: ELF 32-bit LSB executable, ARM, vers
似乎搞ARM开发入门都是用这本书。 上网搜了很久,勉强下载下来了 1分,算是搜索小费啦 然后我还转转成了PDF更合适大家看啦!嘿嘿 介绍如下: 目录 第1 章 ARM 微处理器概述 5 1.1 ARM-Advanced RISC Machines 5 1.2 ARM 微处理器的应用领域及特点 5 1.2.1 ARM 微处理器的应用领域 5 1.2.2 ARM 微处理器的特点 6 1.3 ARM 微处理器系列 6 1.3.1 ARM7 微处理器系列 6 1.3.2 ARM9 微处理器系列 7 1.3.3 ARM9E 微处理器系列 7 1.3.4 ARM10E 微处理器系列 7 1.3.5 SecurCore 微处理器系列 8 1.3.6 StrongARM 微处理器系列 8 1.3.7 Xscale 处理器 8 1.4 ARM 微处理器结构 8 1.4.1 RISC 体系结构 8 1.4.2 ARM 微处理器的寄存器结构 9 1.4.3 ARM 微处理器的指令结构 9 1.5 ARM 微处理器的应用选型 10 1.6 本章小节 10 第2 章 ARM 微处理器的编程模型 11 2.1 ARM 微处理器的工作状态 11 2.2 ARM 体系结构的存储器格式 11 2.3 指令长度及数据类型 12 2.4 处理器模式 12 2.5 寄存器组织 13 2.5.1 ARM 状态下的寄存器组织 13 2.5.2 Thumb 状态下的寄存器组织 15 2.5.3 程序状态寄存器 16 2.6 异常(Exceptions) 18 2.6.1 ARM 体系结构所支持的异常类型 18 2.6.2 对异常的响应 18 2.6.3 从异常返回 19 2.6.4 各类异常的具体描述 19 2.6.5 异常进入/退出小节 20 2.6.6 异常向量(Exception Vectors) 20 2.6.7 异常优先级(Exception Priorities) 21 2.6.8 应用程序中的异常处理 21 2.7 本章小节 21 ARM 应用系统开发详解──基于S3C4510B 的系统设计 2 第3 章 ARM 微处理器的指令系统 22 3.1 ARM 微处理器的指令集概述 22 3.1.1 ARM 微处理器的指令的分类与格式 22 3.1.2 指令的条件域 23 3.2 ARM 指令的寻址方式 23 3.2.1 立即寻址 24 3.2.2 寄存器寻址 24 3.2.2 寄存器间接寻址 24 3.2.3 基址变址寻址 24 3.2.4 多寄存器寻址 25 3.2.5 相对寻址 25 3.2.6 堆栈寻址 25 3.3 ARM 指令集 25 3.3.1 跳转指令 25 3.3.2 数据处理指令 26 3.3.3 乘法指令与乘加指令 30 3.3.4 程序状态寄存器访问指令 32 3.3.5 加载/存储指令 32 3.3.6 批量数据加载/存储指令 34 3.3.7 数据交换指令 35 3.3.8 移位指令(操作) 35 3.3.9 协处理器指令 36 3.3.10 异常产生指令 38 3.4 Thumb 指令及应用 38 3.5 本章小节 39 第4 章 ARM 程序设计基础 40 4.1 ARM 汇编器所支持的伪指令 40 4.1.1 符号定义(Symbol Definition)伪指令 40 4.1.2 数据定义(Data Definition)伪指令 41 4.1.3 汇编控制(Assembly Control)伪指令 43 4.1.4 其他常用的伪指令 45 4.2 汇编语言的语句格式 48 4.2.1 在汇编语言程序中常用的符号 49 4.2.2 汇编语言程序中的表达式和运算符 49 4.3 汇编语言的程序结构 52 4.3.1 汇编语言的程序结构 52 4.3.2 汇编语言的子程序调用 52 4.3.3 汇编语言程序示例 53 4.3.4 汇编语言与C/C++的混合编程 55 4.4 本章小节 56 第5 章 应用系统设计与调试 57 ARM 应用系统开发详解──基于S3C4510B 的系统设计 3 5.1 系统设计概述 57 5.2 S3C4510B 概述 58 5.2.1 S3C4510B 及片内外围简介 58 5.2.2 S3C4510B 的引脚分布及信号描述 61 5.2.3 CPU 内核概述及特殊功能寄存器(Special Registers) 67 5.2.4 S3C4510B 的系统管理器(System Manager) 72 5.3 系统的硬件选型与单元电路设计 82 5.3.1 S3C4510B 芯片及引脚分析 82 5.3.2 电源电路 83 5.3.3 晶振电路与复位电路 83 5.3.4 Flash 存储器接口电路 85 5.3.5 SDRAM 接口电路 89 5.3.6 串行接口电路 93 5.3.7 IIC 接口电路 94 5.3.8 JTAG 接口电路 95 5.3.9 10M/100M 以太网接口电路 96 5.3.10 通用I/O 接口电路 100 5.4 硬件系统的调试 101 5.4.1 电源、晶振及复位电路 101 5.4.2 S3C4510B 及JTAG 接口电路 102 5.4.3 SDRAM 接口电路的调试 103 5.4.4 Flash 接口电路的调试 105 5.4.5 10M/100M 以太网接口电路 105 5.5 印刷电路板的设计注意事项 105 5.5.1 电源质量与分配 105 5.5.2 同类型信号线的分布 106 5.6 本章小节 106 第6 章 部件工作原理与编程示例 107 6.1 嵌入式系统的程序设计方法 107 6.2 部件工作原理与编程示例 108 6.2.1 通用I/O 口工作原理与编程示例 108 6.2.2 串行通讯工作原理与编程示例 111 6.2.3 中断控制器工作原理与编程示例 120 6.2.4 定时器工作原理与编程示例 123 6.2.5 GDMA 工作原理与编程示例 127 6.2.6 IIC 总线控制器工作原理 133 6.2.7 以太网控制器工作原理 138 主要特性 139 MAC 功能模块 140 带缓冲DMA 接口(Buffered DMA Interface) 144 以太网控制器特殊功能寄存器(Ethernet Controller Special Registers) 147 MAC 寄存器(Media Access Control(MAC)Register) 154 以太网控制器的操作(Ethernet Controller Operation) 160 发送一个帧(Transmitting a Frame) 162 ARM 应用系统开发详解──基于S3C4510B 的系统设计 4 接收一个帧(Receiving a Frame) 162 6.2.8 Flash 存储器工作原理与编程示例 162 6.3 BootLoader 简介 167 6.4 本章小节 167 第7 章 嵌入式uClinux 及其应用开发 168 7.1 嵌入式uClinux 系统概况 168 7.2 开发工具GNU 的使用 170 7.2.1 GCC 编译器 170 7.2.2 GNU Make 172 7.2.3 使用GDB 调试程序 177 7.3 建立uClinux 开发环境 180 7.3.1 建立交叉编译器 181 7.3.2 uClinux 针对硬件的改动 184 7.3.3 编译uClinux 内核 185 7.3.4 内核的加载运行 187 7.4 在uClinux 下开发应用程序 188 7.4.1 串行通信 190 7.4.2 socket 编程 195 7.4 .3 添加用户应用程序到uClinux 202 7.4.4 通过网络添加应用程序到目标系统 205 7.5 本章小结 207 第8 章ARM ADS 集成开发环境的使用 209 8.1 ADS 集成开发环境组成介绍 209 8.1.1 命令行开发工具 209 8.1.2 ARM 运行时库 218 8.1.3 GUI 开发环境(Code Warrior 和AXD) 219 8.1.4 实用程序 221 8.1.5 支持的软件 221 8.2 使用ADS 创建工程 222 8.2.1 建立一个工程 222 8.2.2 编译和链接工程 225 8.2.3 使用命令行工具编译应用程序 229 8.3 用AXD 进行代码调试 230 8.4 本章小结 233
FASMARM v1.42 This package is an ARM assembler add-on for FASM. FASMARM currently supports the full range of instructions for 32-bit and 64-bit ARM processors and coprocessors up to and including v8. Contents: 1. ARM assembly compatibility 2. UAL and pre-UAL syntaxes 3. IT block handling 4. Alternate encodings 5. Output formats 6. Control directives 7. Data definitions 8. Defining registers lists inside macros 9. Half-precision number formatting 10. Variants supported 11. Further information 12. Version history _______________________________________________________________________________ 1. ARM assembly compatibility There are a few restrictions how the ARM instruction set is implemented. The changes are minor and mostly have a minor impact. For the most part the basic instruction outline is the same. Where possible the original style is used but there are some differences: Not everything matches the ARM ADS assembly style, where possible the original style is used but there are some differences 1) label names cannot begin with a digit 2) CPSIE and CPSID formats are changed, use "iflags_aif" form instead of "aif" (eg. "CPSIE iflags_i" instead of "CPSID i") 3) SRS with writeback must have a separating space after the mode number and before "!" (eg. "SRSDB 16 !" instead of "SRSDB 16!") 4) macro, rept, irp, format, if, virtual etc. are all significant changes from the ARM ADS, so you will need to re-write those sections of existing code Original ARM Syntax | fasmarm Syntax ----------------------+---------------------- cpsie a | cpsie iflags_a | srsdb #29! | srsdb #29 ! ;or, | srsdb 29 ! _______________________________________________________________________________ 2. UAL and pre-UAL syntaxes fasmarm supports the original pre-UAL syntax and the newer UAL syntax. These two syntaxes only affect THUMB encodings. UAL stands for: Universal Assembly Language. pre-UAL syntax is selected wi

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值