lab1.asm
来自「几个TMS320C54xx的程序」· 汇编 代码 · 共 33 行
ASM
33 行
************************************************
* lab1.asm y= a1*x1+a2*x2+a3*x3+a4*x4 *
************************************************
.title "lab1.asm"
.mmregs
STACK .usect "STACK",10h ;allocate space for stack
.bss a,4 ;allocate 9 word for variates
.bss x,4
.bss y,1
.def _main
.data
table: .word 1,2,3,4 ;data follows ...
.word 8,6,4,2
.text ;code follows ...
_main: STM #0,SWWSR ;adds no wait states
STM #STACK+10h,SP ;set stack pointer
STM #a,AR1 ;AR1 point to a
RPT #7 ;move 8 values
MVPD table,*AR1+ ;from program memory
;into data memory
CALL SUM ;call SUM subrotine
end: B end
SUM: STM #a,AR3 ;The subrotine lmplememt
STM #x,AR4 ;multiply--accumulate
RPTZ A,#3
MAC *AR3+,*AR4+,A
STL A,@y
RET
.end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?