📄 asm1_a.s
字号:
#*********************************************************************************************
# NAME: asm1_a.s *
# Author: Embest *
# Desc: ARM instruction examples *
# History: shw.He 2005.02.22 *
#*********************************************************************************************
/*------------------------------------------------------------------------------------------*/
/* constant define */
/*------------------------------------------------------------------------------------------*/
.equ x, 45 /* x=45 */
.equ y, 64 /* y=64 */
.equ stack_top, 0x1000 /* define the top address for stacks */
.global _start
/*------------------------------------------------------------------------------------------*/
/* code */
/*------------------------------------------------------------------------------------------*/
.text
_start: /* code start */
mov sp, #stack_top
mov r0, #x /* put x value into R0 */
str r0, [sp] /* save the value of R0 into stacks */
mov r0, #y /* put y value into R0 */
ldr r1, [sp] /* read the data from stack,and put it into R1 */
ADD r0, r0, r1
STR r0, [sp]
stop:
b stop /* end the code ,cycling */
.end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -