This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

以下线性汇编编译通不过,谢谢



.def init
.reg dotp4afunc
.text
x_addr .short 1,2,3,4
y_addr .short 0,2,4,6
result_addr .short 0

init MVK result_addr, A4
MVKH result_addr, A4
MVK 0, A3
STH A3, *A4
MVK x_addr, A4
MVK y_addr, B4
MVKH y_addr, B4
MVK 4, A6
B dotp4afunc
MVK ret_addr, b3
MVKH ret_addr, b3
NOP 3

ret_addr MVK result_addr, A0
MVKH result_addr, A0
STW A4, *A0
wait B wait
NOP 5

以下是编译结果

  • 从语句 B dotp4afunc 看你是要跳转到函数dotp4afunc。
    如果函数dotp4afunc定义在另一个文件里,你可以在asm文件里用.global声明它

    另外,我觉得现在没有必要写线性汇编,优化代码可以用TI的intrinsic做C 优化, TI的C6000编译器效率非常高。