This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to Mix C and assembly ?

Hello,
I have the following problem:
I need to know as assigning a position fixed of memory (code)to my functions in C and assembly.

Another consultation:
When I call to a function from C to assembly, the program doesn't continue running, it enters to a code section without "code" (without routine). How do I make so that when calling a function from C to assembly I make sure him to return to the main program?
the routine that I use is the following one:
In C:
extern void FUN1(void);
float a, b;

void main (void) {

while (1) {

FUN1();
a=b*5;

..
..
..

}
}

In Assembly:
NAME FUN1
FUNA SEGMENT CODE
FUNN SEGMENT IDATA RSEG FUNN
DS 2
EXTRN CODE (MAIN)
EXTRN CODE (?C_STARTUP)
PUBLIC FUN1
CSEG AT 80H
FUN1: LJMP WATCH
WDTREL DATA 86H
RSEG FUNA
WATCH:
MOV WDTREL,#80H

END

Thank You....

0