I have a problem. C function call from assembler. Then C function meny parameter.
How to use assembler code?
sorry .
Read: http://www.keil.com/support/man/docs/c51/c51_ap_ctoasm.htm and: http://www.keil.com/support/man/docs/c51/c51_ap_segname.htm and: http://www.keil.com/support/man/docs/c51/c51_ap_datastorage.htm
Then try it by writing a simple example in 'C', and examining the compiler's assembler output to see how it's done!
I have a solution:
C function call of C function.
Disassembly of C function call.
Same action performed by Assembly call.
Everyone happy.
This is experienced, I have found no documentation.
when mising C and assembler, you MUST have a mainj() in C.
org 0 ljmp start start: lcall Croutine jmp start
does not generate a call tree
void main(void { start(); } start: lcall Croutine jmp start
generates a call tree
Erik
I think the tools (particularly, the Linker) take the presence of a 'C' main() function as their clue to include all the necessary runtime support.
It might be possible to do it all manually, but it's probably far easier to just ensure that you have a main() in 'C'.
BTW: this is why projects don't work when all the 'C' files have the SRC option specified...
"I think the tools (particularly, the Linker) take the presence of a 'C' main() function as their clue to include all the necessary runtime support."
Looks very similar to a discussion from not too long ago:
http://www.keil.com/forum/docs/thread11848.asp
ah one more nugget
in the assembler modules, do not forget that OVERLAYABLE exist.