Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 2nd July 2007, 08:44 AM   (permalink)
Default Integrating PIC ASM as a callable function from C18

I have a large C18 project currently in place that requires a few functions to be tightly controlled in assembly language. Inline __asm isn't cutting it. Does anyone know of any documentation or existing projects have have a C18 calling a function from a MPASM compiled .asm file, as well as C18 functions being called from an assembly function?
toodles is offline  
Old 2nd July 2007, 08:51 PM   (permalink)
Default

Inline Assembly

Assembler code can be included in the C code, the block of assembly code starts with _asm and ends with _endasm:
_asm
[label:] [ [arg1[, arg2[, arg3]]]]
_endasm
v1r05 is offline  
Old 3rd July 2007, 01:02 AM   (permalink)
Default

Quote:
Originally Posted by toodles
I have a large C18 project currently in place that requires a few functions to be tightly controlled in assembly language. Inline __asm isn't cutting it. Does anyone know of any documentation or existing projects have have a C18 calling a function from a MPASM compiled .asm file, as well as C18 functions being called from an assembly function?
Have you taken a look at the library source code that's included with C18? As I remember it, the memcpy routine is written in assembler using the C18 calling conventions... that might provide you the skeleton you need for your routine.

Regards,
Paul
aussiepoof is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Binary division Kenyan algorithm 18F family atferrari Micro Controllers 6 3rd May 2007 09:26 PM
Newcomers, please read! (PIC regarded) Upd. 0xD Jay.slovak Micro Controllers 0 17th April 2005 02:05 PM



All times are GMT. The time now is 09:47 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker