piot1.asm
来自「DSP学习讲座」· 汇编 代码 · 共 117 行
ASM
117 行
;
; Copyright 2001 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.
;
;
; "@(#) DSP/BIOS 4.60.22 12-07-01 (barracuda-j15)"
;
; ======== echo_asm.s62 ========
;
; C-callable interface to assembly language utility functions for the
; volume example.
.global startp
.text
;
; ======== _load ========
; This function simulates a load on the DSP by executing N * loopCount
; instructions, where loopCount is the input parameter to load().
;
; void _load(int loopCount)
;
; The loop is using 8 instructions. One instruction for sub, nop and
; b, plus nop 5. The extra nop added after sub is to make the number
; of instructions in the loop a power of 2.
;
startp:
mvk.s2 0x0000,b0 ;loop counter
mvkh.s2 0x0001,b0
mvk.s2 0x0001,b1
mvkh.s2 0x00000000,b1;initial output data
mvk.s2 0x0001,b3 ;increment quantity
mvkh.s2 0x00000000,b3
mvk.s2 0x00000004,b2 ;output address
mvkh.s2 0xb0000000,b2
nop
nop
mvk.s2 0x00000000,b5 ;input address
mvkh.s2 0xb0000000,b5
nop
nop
nop
loop1: ldw.d2 *b5, b4
nop
nop
stw b1, *b2
nop
nop 3
mvk.s1 0x00001004,a1 ;loop count delayt
mvkh.s1 0x00050000,a1
nop
nop
dlt1: sub a1,1,a1
nop
nop
nop
[a1] b.s1 dlt1
nop
nop
nop
nop
nop
nop
add b1,b3,b1
nop
nop
sub b0,1,b0
nop
nop
[b0] b.s2 loop1
nop
nop
nop
nop
nop
nop
nop
b startp
nop
nop
nop
nop
nop
nop
nop
nop
mv a4, b0 ; use b0 as loop counter
[!b0] b lend
mvk 0x1000,b1
mpy b1,b0,b0
nop
shru b0,3,b0 ; (loop counter)= (# loops)/8
loop:
sub b0,1,b0
nop
[b0] b loop
nop 5
lend: b b3
nop 5 ; return
.end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?