Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

C and assembly Mix programing

Status
Not open for further replies.

cool_harry

Newbie level 2
Newbie level 2
Joined
Aug 20, 2007
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top