ARM 体系结构与编程专栏
Johhny Rade
年青
展开
-
ARM 体系结构与编程 - Data definition
https://developer.arm.com/documentation/100068/0616/Migrating-from-armasm-to-the-armclang-Integrated-Assembler/Data-definition-directives .global _start _start: mov r0, #Label1 ldr r1, Label1 ldr r1, Label2 ldr r1, Label3 ldr r1, Label4 //mov r0, #Label3原创 2021-10-11 16:30:35 · 115 阅读 · 0 评论 -
ARM 体系结构与编程 - Label
参考资料: https://developer.arm.com/documentation/100068/0616/Migrating-from-armasm-to-the-armclang-Integrated-Assembler/Labels 跳转 MOV R5, #1 MOV R6, #2 BL final //LR = 0x0c MOV R7, #3 //skipped MOV R8, #4 //skipped final: 循环 loop: MOV R5, #1 MOV原创 2021-10-09 17:53:24 · 268 阅读 · 0 评论 -
ARM 体系结构与编程 - Numeric local labels
参考资料 https://developer.arm.com/documentation/100068/0616/Migrating-from-armasm-to-the-armclang-Integrated-Assembler/Numeric-local-labels?lang=en .global _start _start: MOV r4,#1 // r4=1 1: // Local label原创 2021-10-11 15:49:22 · 140 阅读 · 0 评论 -
ARM 体系结构与编程 - 跳转指令
ARM的跳转指令可以从当前指令向前或向后32MB的地址空间跳转。这类跳转指令有以下4种。 ● B:B{L}{} <target_address> _start: MOV R5, #1 MOV R6, #2 B final MOV R7, #3 //skipped MOV R8, #4 //skipped final: ● BL:带返回的跳转指令。 _start: MOV R5, #1 MOV R6, #2 BL final //LR = 0x0c MOV R7, #3原创 2021-09-09 15:16:27 · 601 阅读 · 0 评论 -
ARM 体系结构系列——数据处理指令
1. 指令功能 ASR provides the signed value of the contents of a register divided by a power of two. It copies the sign bit into vacated bit positions on the left. LSL provides the value of a register multiplied by a power of two. LSR provides the unsigned valu原创 2021-09-08 10:58:50 · 562 阅读 · 0 评论 -
ARM 体系结构与编程 - 条件执行
ref link 1. 仿真实验 MRS R0, CPSR //CPSR to R0 MOV R1, #0x01 ORR R0, R0, R1, LSL 30 // set Z flag MSR CPSR_c, R0 //R0 to CPSR EQMOV R3, #0x01 //do it NEMOV R3, #0x02 //skip this BIC R0, R0, R1, LSL 30 // clear Z flag MSR CPSR_c, R0 //R0 to CPSR EQMOV R3,原创 2021-09-10 15:13:19 · 115 阅读 · 0 评论 -
ARM体系结构与编程 - CPSR
ref link 1. 基本概念 机器指令不区分有符号数或无符号数! 参考资料 2. 仿真实验 ● ADD MOV R1, #0x80000000 MOV R0, #0x80000000 ADDS R2, R1, R0 //最高位向更高位进位 -- C flag 设置; 最高位均为1,相加得0,-- V flag设置;R0 = 0, Z flag设置 ● SUB MOV R1, #0x80000000 MOV R0, #0x01 SUBS R2, R1, R0 //最高位从1,变成0 -- V fl原创 2021-09-10 14:35:09 · 177 阅读 · 0 评论 -
ARM 体系结构系列——Load/Store指令
1. 字 加载存储指令 ● [<Rn>, #+/-<offset_12>] MOV R1, #0x100 MOV R0, #0x8 STR R0, [R1] ;address 0x100 {0x00 00 00 08} STR R0, [R1, #4] ;address 0x104 {0x00 00 00 08} MOV R1, #0x100 LDR R2, [R1] ; 将内存单元R1中的字读取到R2寄存器中 R2原创 2021-09-09 14:15:22 · 2317 阅读 · 0 评论
分享