I am very new to Microcontroller programming particularly PIC18F87J11, and I am using MPLAB C18 compiler. I was reading the datasheet for various topics such as saving to memory or working with timers. I noticed the examples are written in assembly language, but I have minimum experience with it. Is there a way to use the power of Assembly and C together in my project?
I do not understand assembly that good or else I would try to convert the code to C, in this case, I rather just use the assembly code with few changes.
Now can someone show me an example of how you would use an assembly function in a C program with MPLAB C18 compiler?
The assembly function can be as simple as hello world. I just need to understand the process of combing and using two different languages on MPLAB. I tried to create a quick function for testing, but I did not know where to put the assembly code. Do assembly codes need their own files included in the project?
I hope someone can enlighten me with a full simple example just to be able to see the big picture. I appropriate the help in advance, thanks!
__asm
in c but if you have asm compiler you can create asm lib and use it then like here descripted: dreamincode.net/forums/topic/… – cnd__asm
in the C standard, but most current actual C compilers do implement something of that sort, though the syntax will vary. The question does not reference the C standard, but rather a particular named compiler. – Chris Stratton