linux-arm-demo/driver/board_driver/01-led/led.s
2025-12-11 20:42:59 +08:00

12 lines
432 B
ArmAsm
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.global _start @ 声明入口为_start
_start:
ldr sp, =0x40000000 @ 设置栈指针(根据硬件调整地址)
@ 这里写你的LED操作代码示例往寄存器写值
ldr r0, =0x40000000 @ 假设LED寄存器地址是0x40000000
ldr r1, =0x01 @ 要写入的值点亮LED
str r1, [r0] @ 把r1的值写入r0指向的地址
loop:
b loop @ 死循环(防止程序跑飞)