echo_asm.s54

来自「《DSP集成开发环境-CCS及DSP/BIOS的原理与应用》」· S54 代码 · 共 54 行

S54
54
字号
;;  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.s54 ========
;  C-callable interface to assembly language utility functions for the
;  echo example.
;

    .mmregs

    .global _ECHO_load

    .text

N       .set    1000

;
;  ======== _ECHO_load ========
;  This function simulates a load on the DSP by executing N * loopCount
;  instructions, where loopCount is the input parameter to ECHO_load().
;
;      void ECHO_load(int loopCount)
;
;  true execution time: ?? + N * (loop count)
;
_ECHO_load:
        sub     #1, a
        stlm    a, ar4          ; ar4 = loopCount - 1
        ld      #(N/4-2), a     ; a = (N / 4) - 2
loop:   
        stlm    a,brc           ; initialize count register for block rpt
        nop
        nop
        rptb    $1
        nop
        nop
        nop
$1      nop
        banz    loop, *ar4-

    .if __far_mode      ; -mf flag will assemble far mode return opcode
        fret
    .else
        ret
    .endif
    
    .end

⌨️ 快捷键说明

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