utl_loop.s62
来自「使用於 TI dsk6711中的很多好用的例子可以看」· S62 代码 · 共 48 行
S62
48 行
;
; Copyright 2003 by Texas Instruments Incorporated.
; All rights reserved. Property of Texas Instruments Incorporated.
; Restricted rights to use, duplicate or disclose this code are
; granted through contract.
;
; @(#) XDAS 2.51.00 11-29-2003 (xdas-2.50.00.9)
;
;
; ======== utl_loop.s62 ========
; Simulate load on the DSP for the audio example.
;
;
.global _UTL_loop
.text
N .set 1000 ; N must be evenly-divisible by 10
;
; ======== _UTL_loop ========
; This function simulates a load on the DSP by executing N * loopCount
; instructions, where loopCount is the input parameter to UTL_loop().
;
; void UTL_loop(int loopCount)
;
; Actual instruction cycles: 6 + N * (loopCount)
;
; Limitation: The code assumes that loopCount is at most 0xffff, so with
; N=1000 the maximum delay allowed is: 6 + 1000 * 65535 = 65,535,006
; instructions. N can be increased if you need more cycles.
_UTL_loop:
mvk (N/10),b0
mpyu a4,b0,b0
nop 4
loop:
sub b0,1,b0
nop 3
[b0] b loop
nop 5
b b3
nop 5
.end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?