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

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

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

ソリューションへジャンプ
2,259件の閲覧回数
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 解決策
1,634件の閲覧回数
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 返答(返信)
1,635件の閲覧回数
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 件の賞賛
返信
1,634件の閲覧回数
Pablos
Contributor I

Thanks it is working OK

0 件の賞賛
返信
1,634件の閲覧回数
CrasyCat
Specialist III

Hello

 

Which MCU are you targeting?

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

 

CrasyCat

0 件の賞賛
返信
1,634件の閲覧回数
Pablos
Contributor I

The CPU is MC9S08AW32 and I am working with CodeWarrior

0 件の賞賛
返信