How to include a piece of assembler language  in  a C program

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to include a piece of assembler language  in  a C program

跳至解决方案
1,387 次查看
Pablos
Contributor I

Hello

I am not able to solve the problem of variable  used in 'C'  part and those  used in assembler part.

I have defined in "C" program

byte name[5]

I want to include a piece of assembler already done where I have

asm

{

........

LDHX  (how I can load the address of Name[0] i.e... the address of the beginning of vector used in "C")

}

How I can use the variables I have in "C" part of program in assembler part and conversely.

Suggest me some fonts.

Thanks

Paolo

标签 (1)
0 项奖励
回复
1 解答
762 次查看
CompilerGuru
NXP Employee
NXP Employee

Check the compiler manual for the S08, it has a HLI chapter.

When I remember right, the syntax is LDHX @name:0, but did not test it out.

 

Daniel

在原帖中查看解决方案

0 项奖励
回复
4 回复数
763 次查看
CompilerGuru
NXP Employee
NXP Employee

Check the compiler manual for the S08, it has a HLI chapter.

When I remember right, the syntax is LDHX @name:0, but did not test it out.

 

Daniel

0 项奖励
回复
762 次查看
Pablos
Contributor I

Thanks it is working OK

0 项奖励
回复
762 次查看
CrasyCat
Specialist III

Hello

 

Which MCU are you targeting?

Which compiler are you using (Freescale, ...)?

 

CrasyCat

0 项奖励
回复
762 次查看
Pablos
Contributor I

The CPU is MC9S08AW32 and I am working with CodeWarrior

0 项奖励
回复