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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,223 Views
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

Labels (1)
0 Kudos
Reply
1 Solution
598 Views
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

View solution in original post

0 Kudos
Reply
4 Replies
599 Views
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 Kudos
Reply
598 Views
Pablos
Contributor I

Thanks it is working OK

0 Kudos
Reply
598 Views
CrasyCat
Specialist III

Hello

 

Which MCU are you targeting?

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

 

CrasyCat

0 Kudos
Reply
598 Views
Pablos
Contributor I

The CPU is MC9S08AW32 and I am working with CodeWarrior

0 Kudos
Reply