Mixing C and assembler code for TI MSP430F149 controller

Status
Not open for further replies.

MagicSpark

Newbie level 5
Joined
Oct 17, 2006
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,370
I have assembler project based on the TI MSP430F149 controller. I need to convert it to C. Our approach is to mix assembler and C code together, and then slowly rewrite pieces of assembler code. So I have the following questions:

I've added C file to the project containing main() function. Do I have to take special care to redirect reset vector at 0xFFFEh to call main function or C compiler/linker will do that for me?

Obviously C code is converted to assembler and placed into CODE segment. I need to know whether that assembler code (from C) will be placed to separate CODE segment or to the existing CODE segment with existing assembler code?

I have COMMON segment in assembler code where interrupt vector is defined.
I assume that C compiler/linker will have to make necessary changes there in order to call main on reset (power on) interrupt. Should I leave reset vector undefined in assembler code? Should I define reset vector in C? How this will interact with existing interrupt vector ion COMMON segment in assembler code?

Thanks in advance

P.S. I use IAR workbench IDE
 

HI

Search TI site there are several program who written fro IAR for mixed C and ASM

Read the IAR user manuel to know more on how to use mixed C and ASM

Also in TI site there is application note show how to mix ASM and C

All the best

Bobi
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…