delay.s

来自「AT91所有开发板的资料 AT91所有开发板的资料」· S 代码 · 共 71 行

S
71
字号
        SUBT    Evaluator Support             > delay.s;; $Revision:  $;   $Author:  $;     $Date:  $;; Copyright (c) 1996 Advanced RISC Machines Limited; All Rights Reserved;; ---------------------------------------------------------------------                GET     listopts.s                GET     lolevel.s                ASSERT  (listopts_s)old_opt         SETA    {OPT}                OPT     (opt_off)       ; disable listing of include files; ---------------------------------------------------------------------    [   (:LNOT: :DEF: etherser_s)	GBLL    delay_sdelay_s	SETL    {TRUE}	AREA    |delay|, CODE, READONLY; ---------------------------------------------------------------------;; delay - delay for a given number of microseconds;; This routine is actually hopelessly inaccurate, as it depends upon; the system clock frequency, and the speed of the memory it is running; from.  It is written assuming that it is running on an ARM7T; clocked at 25MHz in single-cycle SSRAM; if this is not the case,; then it will just delay for proportionately shorter or longer.;;; we loop 4 times for every microsecond.  This gives a total of 28 ARM7T; clocks per microsecond - an error of 12%, which we can probably cope with.;; Note that, with the SRAM on the Evaluator, with 1 wait state at 50Mhz, the;effective  access time is the same as for the 25MHz case mentioned above.;	EXPORT  delayloopdelayloop		mov	r0, r0, lsl #25	mov	r0, r0	subs	r0, r0, #1	moveq	pc, lr	b	%5; ---------------------------------------------------------------------    ]   ; delay_s	EXPORT	traceRegstraceRegs        OPT     (old_opt)   ; restore previous listing options; ---------------------------------------------------------------------        END; EOF delay.s

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?