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, #Label1ldr r1, Label1ldr r1, Label2ldr r1, Label3ldr r1, Label4//mov r0, #Label3原创 2021-10-11 16:30:35 · 114 阅读 · 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 //skippedfinal:循环loop: MOV R5, #1 MOV原创 2021-10-09 17:53:24 · 260 阅读 · 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=11: // Local label原创 2021-10-11 15:49:22 · 135 阅读 · 0 评论 -
ARM 体系结构与编程 - 跳转指令
ARM的跳转指令可以从当前指令向前或向后32MB的地址空间跳转。这类跳转指令有以下4种。● B:B{L}{} <target_address>_start:MOV R5, #1MOV R6, #2B finalMOV R7, #3 //skippedMOV R8, #4 //skippedfinal:● BL:带返回的跳转指令。_start: MOV R5, #1 MOV R6, #2 BL final //LR = 0x0c MOV R7, #3原创 2021-09-09 15:16:27 · 586 阅读 · 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 · 537 阅读 · 0 评论 -
ARM 体系结构与编程 - 条件执行
ref link1. 仿真实验MRS R0, CPSR //CPSR to R0MOV R1, #0x01ORR R0, R0, R1, LSL 30 // set Z flagMSR CPSR_c, R0 //R0 to CPSREQMOV R3, #0x01 //do itNEMOV R3, #0x02 //skip thisBIC R0, R0, R1, LSL 30 // clear Z flagMSR CPSR_c, R0 //R0 to CPSREQMOV R3,原创 2021-09-10 15:13:19 · 108 阅读 · 0 评论 -
ARM体系结构与编程 - CPSR
ref link1. 基本概念机器指令不区分有符号数或无符号数!参考资料2. 仿真实验● ADDMOV R1, #0x80000000MOV R0, #0x80000000ADDS R2, R1, R0 //最高位向更高位进位 -- C flag 设置; 最高位均为1,相加得0,-- V flag设置;R0 = 0, Z flag设置● SUBMOV R1, #0x80000000MOV R0, #0x01 SUBS R2, R1, R0 //最高位从1,变成0 -- V fl原创 2021-09-10 14:35:09 · 169 阅读 · 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 · 2250 阅读 · 0 评论