C and assembly Mix programing

Status
Not open for further replies.

cool_harry

Newbie level 2
Joined
Aug 20, 2007
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,295
Hi, i am using 8051 core controller and Keil compiler.I have written a code in C. Now i need some of its routines to be converted into assembly. Plz tell me how to start.
Specifically i need guidance on how to call a Assembly func from C program where i am passing 2 unsigned long variable into that func. For eg. asm(var1,var2);
where var1 & var 2 are unsigned long datatypes and asm is a function written in assembly...
 

To keep it simple, I usually start from SRC compiler directive of Keil. I write a skeleton of function and let Keil help me to create a skeleton in ASM itself. Afterwards I include asm file with full instead of previous .C file and let .H as it is.

Sometimes I only write whole C function and only make complete or partial hand-optimization with the help of asm/endasm directives.

Last but not least, everything about mixing C and ASM codes is described in Keil's manuals, so if you need to know more RTFM.

Jan
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…