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.

[参考译文] 编译器/MSP430G2211:错误、包括项目中的汇编器源文件(.s43)

Guru**** 2387830 points
Other Parts Discussed in Thread: MSP430G2211
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/592977/compiler-msp430g2211-errors-including-assembler-source-files-s43-in-project

器件型号:MSP430G2211

工具/软件:TI C/C++编译器

我正在尝试在 msp430g2211上为 PID 控制器实现高效的乘法和除法。 我参考了应用手册 :www.ti.com/.../slaa329.pdf

我使用的是 CCS 7.1.0。

当我向项目中添加一个文件时、如上述应用手册中的 Horner_mul_int.s43、我会在每一行中看到错误"指定了非法助记符"。 包含汇编器源文件和访问 main.c 中的外部函数的正确过程是什么?

Horner_mul_int.s43

#include "msp430g2211.h"

名称Horner_mul_int
公共 mul_Horner_int

RSEG 代码

Mul_Horner_int

MOV.w R12、R13 ;寄存器 R12中的操作数"输入"
RLA.w R13.
添加 R12、R13 ; X1=X*2^1+X
RLA.w R13.
RLA.w R13.
添加 R12、R13 ; X2=X1*2^2+X
RLA.w R13.
添加 R12、R13 ; X3=X2*2^1+X
RLA.w R13.
添加 R12、R13 ; X4=X4*2^1+X
RLA.w R13.
RLA.w R13.
RLA.w R13.
添加 R12、R13 ;最终结果=X1=X4*2^3+X
MOV.w R13、R12 ;最后的答案返回到
;调用函数
可重置
结束



 

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Oliver、

    请查看我们的应用报告 《将 C 和汇编器与 MSP430混合》。 此报告描述了将汇编语言包含在项目中的正确过程。 如果遇到任何问题、请告诉我。

    此致、

    Caleb Overbay