Can I compile an assembly file(.s file) with .c files in codewarrior10.6?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Can I compile an assembly file(.s file) with .c files in codewarrior10.6?

ソリューションへジャンプ
4,289件の閲覧回数
weiranhe
Contributor II

Hi! I'm using CW10.6 for MPC5646B, now I need to add an assembly file(.s file) to my project, can I compile it with other .c files? I try it, but it makes a lot of errors.

Can anybody help me? There is an function in the assembly file, I need to call it in another .c file.

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
2,523件の閲覧回数
TICS_Fiona
NXP Employee
NXP Employee

Sorry for the waiting.

The reported errors are due to project is created for VLE instructions and assembly file (.s) added has a BOOKE instructions.

By adding the option -ppc_asm_to_vle in (Project Properties->C/C++ Build->Settings->Tools Seetings -> PowerPC Assembler -> General -> Other Flags), the below reported error should be resolved. (convert UISA/BOOKE  instructions to VLE)


Best Regards

Fiona

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

4 返答(返信)
2,524件の閲覧回数
TICS_Fiona
NXP Employee
NXP Employee

Sorry for the waiting.

The reported errors are due to project is created for VLE instructions and assembly file (.s) added has a BOOKE instructions.

By adding the option -ppc_asm_to_vle in (Project Properties->C/C++ Build->Settings->Tools Seetings -> PowerPC Assembler -> General -> Other Flags), the below reported error should be resolved. (convert UISA/BOOKE  instructions to VLE)


Best Regards

Fiona

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

2,523件の閲覧回数
weiranhe
Contributor II

I have tried the advice you have given, and the errors disappeared.Thank you!

By the way, I have payed attention to your personal home page.


0 件の賞賛
返信
2,523件の閲覧回数
TICS_Fiona
NXP Employee
NXP Employee

I tried with CodeWarrior v10.6, and also have problem with the assembly file compiling. I have contacted compiler team for the solution.

Now, you can use embedded assembly code in C file to work it around, just like below:

__declspec(section ".init") __asm void cfg_WATCHDOG(void);

__asm void cfg_WATCHDOG(void)

{

               nofralloc

               /* Clear the soft lock bit SWT_CR.SLKSWT_CR: */

               /* SR --> 0x0000c520 */

lis r4, 0

ori r4, r4, SR_WSC_1@l

lis r3, SWT_SR@ha

stw r4, SWT_SR@l(r3)

/* SR --> 0x0000d928 */

lis r4, 0

ori r4, r4, SR_WSC_2@l

stw r4, SWT_SR@l(r3)

/* Disable watchdog, SWT.CR.WEN = 0*/

lis r4, CR_VALUE@h

ori r4, r4, CR_VALUE@l

lis r3, SWT_CR@ha

stw r4, SWT_CR@l(r3)

       blr

}

I will get back to this issue as soon as I have the solution for assembly files compiling in CW10.6.

2,523件の閲覧回数
bibinputhiyath
Contributor II

In KDS2.0 how can i compile .S file with .c file. I couldn't find 'PowerPC Assembler' in Project Properties->C/C++ Build->Settings->Tools Seetings -> PowerPC Assembler

Thanks!

0 件の賞賛
返信