⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex5p12.asm

📁 用于DSK5416的程序
💻 ASM
字号:
***************************************************************************
*
* This program computes multiply and accumulate using indirect
* addressing mode.
*
*       y(n) = h(0)x(n) + h(1)x(n-1) + h(2)x(n-2)
*       
*       h(0), h(1), and h(2) are stored in data memory locations starting at
*       location h. x(n), x(n-1), and x(n-2) are stored in data-memory
*       locations 310h, 311h, & 312h resp. y(n) is saved in data-memory
*       location 313h (low 16 bits) and 314h (high 16 bits.
*
***************************************************************************	

        .global _c_int00
     
h       .int 10, 20, 30
	
        .text

_c_int00:
        SSBX    SXM                     ; select sign extension mode
        STM     #310h, AR2              ; Initialize pointer AR2 for x(n) stored at 310h
        STM     #h, AR3                 ; Initialize pointer AR3 for coefficients
	
        MPY     *AR2+, *AR3+, A         ; A = x(n)*h(0)
	
        MPY     *AR2+, *AR3+, B         ; B = x(n-1)*h(1)
	
        ADD     A, B                    ; B = x(n)*h(0) + x(n-1)*h(1)
	
        MPY     *AR2+, *AR3+, A         ; A = x(n-2)*h(2)
	
        ADD     A, B                    ; B = x(n)*h(0) + x(n-1)*h(1) + x(n-2)*h(2)
	        
        STL     B, *AR2+                ; Save low part of result
        STH     B, *AR2+                ; Save high part of result
        NOP                             ; No operation

    	.end		     
	

⌨️ 快捷键说明

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