Topic : How to use assembly code in 8051 c programs in the RIDE ide ?

Forum : 8051

Original Post
Post Information Post
April 14, 2008 - 11:14am
Guest

please help me on how to use asm code as a part of c code in RIDE ide. suggest me any materail to follow or read on this.

Replies
Post Information Post
+1
0
-1
April 14, 2008 - 3:49pm
Guest

the easy way is to make a skeleton function in C and then use the generated assembler as a basefor the assemler module.

Erik

+1
0
-1
April 14, 2008 - 5:16pm
Guest

Have a look at the section 3.6 in the RC51.pdf RC51 Compiler manual (around page 39), and at the example in C:\RIDE\EXAMPLES\8051\GENERAL\C_ASM.

Lionel

+1
0
-1
August 25, 2009 - 11:09am
Guest

I think I have found a bug. If you declare an external function that takes void as parameter and call it from your C-Program the Linker (LX51) reports "***Error 100: UNRESOLVED EXTERNAL SYMBOL : fct3(MAIN)

Example:

extern void fct3(void) reentrant;

void main(){
fct3();
}

You can test this by adjusting the aforementioned example (C:\RIDE\EXAMPLES\8051\GENERAL\C_ASM) accordingly.

+1
0
-1
August 27, 2009 - 4:33pm
Guest

Did you declare the function as reentrant in the definition ? The naming of a reentrant (versus non-reentrant) is different. It allows to check that the parameters are stored at the right place.

+1
0
-1
August 28, 2009 - 11:56am
Guest

Removing the reentrant attribute indeed fixed the error, thanks.