配置
![](https://note.wiz.cn/api/document/files/unzip/10714423-6f64-429d-9a78-7a45a05e9295/c6a4ae7d-722d-4c2b-a265-0635ef094a85.1360/index_files/23741234.png)
![](https://note.wiz.cn/api/document/files/unzip/10714423-6f64-429d-9a78-7a45a05e9295/c6a4ae7d-722d-4c2b-a265-0635ef094a85.1360/index_files/23774031.png)
![](https://note.wiz.cn/api/document/files/unzip/10714423-6f64-429d-9a78-7a45a05e9295/c6a4ae7d-722d-4c2b-a265-0635ef094a85.1360/index_files/23790484.png)
![](https://note.wiz.cn/api/document/files/unzip/10714423-6f64-429d-9a78-7a45a05e9295/c6a4ae7d-722d-4c2b-a265-0635ef094a85.1360/index_files/23802843.png)
![](https://note.wiz.cn/api/document/files/unzip/10714423-6f64-429d-9a78-7a45a05e9295/c6a4ae7d-722d-4c2b-a265-0635ef094a85.1360/index_files/23811843.png)
![](https://note.wiz.cn/api/document/files/unzip/10714423-6f64-429d-9a78-7a45a05e9295/c6a4ae7d-722d-4c2b-a265-0635ef094a85.1360/index_files/23857906.png)
![](https://note.wiz.cn/api/document/files/unzip/10714423-6f64-429d-9a78-7a45a05e9295/c6a4ae7d-722d-4c2b-a265-0635ef094a85.1360/index_files/23946875.png)
![](https://note.wiz.cn/api/document/files/unzip/10714423-6f64-429d-9a78-7a45a05e9295/c6a4ae7d-722d-4c2b-a265-0635ef094a85.1360/index_files/24027671.png)
DebugInRam.ini
//*** <<< Use Configuration !disalbe! Wizard in Context Menu >>> ***
FUNC void Setup (void)
{
// <o> Program Entry Point
pc = 0x00000000;
}
map 0x0c000000, 0x0c800000 read write
Setup(); // Setup for Running
代码
一个简单的汇编代码(空4格)
AREA test,CODE,READONLY
ENTRY
start
MOV r0, #10
MOV r1, #3
ADD r0, r0, r1
END
第二个
AREA Example,CODE,READONLY ;声明代码段Example
ENTRY ;标识程序入口
CODE32 ;声明32位ARM指令
START MOV R0,#0 ;设置参数
MOV R1,#10
BL ADD_SUB;调用子程序ADD_SUB
LOOP B LOOP ;跳转到LOOP
ADD_SUB
ADD R0,R0,R1 ;R0 = R0 + R1
MOV PC,LR ;子程序返回
END ;文件结束
标号一定顶格写,汇编指令一定不能顶格写
汇编未操作AREA 定义一个段,段名为EXAMPLE,CODE表明为代码段,属性为只读(READONLY),ENTRY为程序入口,END表明源代码结束
ldr
![](https://note.wiz.cn/api/document/files/unzip/10714423-6f64-429d-9a78-7a45a05e9295/c6a4ae7d-722d-4c2b-a265-0635ef094a85.1360/index_files/81546203.png)
![](https://note.wiz.cn/api/document/files/unzip/10714423-6f64-429d-9a78-7a45a05e9295/c6a4ae7d-722d-4c2b-a265-0635ef094a85.1360/index_files/81555656.png)
- 读取标号loop的地址放入文字池,pc为执行时pc的地址,0x14为最后一句指定地址-0x4
网友评论