//主程序
#include "msp430x44x.h"
extern cheng
//====================================
NAME main
ORG 0FFFEh
DW RESET
//---------------------------------
RSEG CSTACK
RSEG CODE
;---------------------------------
RESET mov.w #SFE(CSTACK),SP;CSTACK=0200-0A00
main mov.w #WDTPW+WDTHOLD,&WDTCTL
//-------------------------------------
mov.w #20,R14;
mov.w #40,R12;
call #cheng//结果在R12
//-------------------------------------
main1
jmp main1
//--------------------------------
END
//子程序
#include "msp430x44x.h"
//extern unsigned int ?Mul16Hw(unsigned int,unsigned int);
unsigned int cheng(unsigned int i1,unsigned int i2)
{
return(i1*i2);
}
错误提示:
//Error[e46]: Undefined external "?Mul16Hw" referred in chengc
如何解决
我试了一下,没什么问题,如果是新版本的IAR,两个参数应该分别放在R12和R13中
我的不行啊,不知道什么问题
我用的是
IAR Assembler for MSP430
V3.42A/W32 (3.42.1.9)