I'm doing some Microchip PIC programming in C with MPLAB but I need to do some serial communication (receive only actually) so I'm using some assembly code from their app notes. Right now I'm just doing the SCI by itself in its own project, but I don't know how to call the assembly and get the return via C. I only know C from what I've done with this project and next to no assembly. The CCS compiler manual I have has only a tiny note about #ASM. Basically I want to use C in my test program to check if one of the asm bits is clear or not (indicating if a a receive is in progress or not) then when it becomes clear I need to pull the byte of data from one of the asm registers.
Can someone give me a basic example how to do that?
The code from the 'main program loop' is below.
Basically I guess I'd like to do the same things that happen there in a while loop in my void main() since I feel more comfortable with C. Like I don't know if I can call ASM functions like I would call a C function or what, and if the interrupts happen the same way as in C.
Can someone give me a basic example how to do that?
The code from the 'main program loop' is below.
Basically I guess I'd like to do the same things that happen there in a while loop in my void main() since I feel more comfortable with C. Like I don't know if I can call ASM functions like I would call a C function or what, and if the interrupts happen the same way as in C.