📄 ledasm.s
字号:
/* * ledasm.S: simple LED control code * * Copyright (C) 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *//* * Documentation: * [1] Intel Corporation, "Intel StrongARM SA-1100 Microprocessor * Developer's Manual", April 1999 * [2] Intel Corporation, "Intel StrongARM SA-1110 Microprocessor * Advanced Developer's manual, December 1999 */.ident "$Id: ledasm.S,v 1.3 2001/10/28 20:29:05 erikm Exp $"#ifdef HAVE_CONFIG_H# include <blob/config.h>#endif#include <blob/arch.h>.text.globl ledinitledinit:.globl led_onled_on: ldr r0, =PDATB ldr r1, [r0] bic r1, r1, #0x200 str r1, [r0] mov pc, lr.globl led_offled_off: ldr r0, =PDATB ldr r1, [r0] orr r1, r1, #0x200 str r1, [r0] mov pc, lr /* busy wait loop. clobbers r0 */wait_loop: mov r0, #0x400000wait_loop1: subs r0, r0, #1 bne wait_loop1 mov pc, lr.globl led_blink /* blinks LED r0 times */ /* clobbers r0 - r4 */led_blink: mov r4, lr mov r3, r0blink0: bl led_off bl wait_loop bl led_on bl wait_loop subs r3, r3, #1 bne blink0 mov pc, r4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -