mixing c and assembly pic
Hi, I am currently implementing some algorithms on a pic microcontroller. I'm using the PIC18f452. i am however having problems calling c functions from the assembly code. The following is a section of my code:
auto char recvd_coord; // recvd coordinates
auto char current_coord; // current coordinates
extern unsigned char perform_xaveraging(auto char a,auto char b);
void main(void) {
auto char p;
p = perform_xaveraging (recvd_coord,current_coord);
}
/* functions to perform averaging calculation */
extern unsigned char perform_xaverageing (auto char a,auto char b) {
near auto char z;
if (current_coord>POSITIVE_XERR_RANGE || current_coord<NEGATIVE_XERR_RANGE ){
(a + b)/2 ;
z = ((a + b)/2);
return z;
}
else {
(a + b)/2 ;
z =((a + b)/2);
return z;
}
}
any ideas will be greatly appreciated,
akub3