??? 08/17/07 19:12 Read: times |
#143382 - You can call ASM from C... Responding to: ???'s previous message |
... you just have to play by the Compiler's rules - known more formally as its Calling Conventions
See: http://www.keil.com/support/m...ctoasm.htm If you are writing new assembler routines, you can easily write them to be callable from 'C'; Existing assembler routines probably won't have been written to be callable from 'C', so the best approach is probably to write a "wrapper" in assembler that makes them so. There would be very little point at all in writing something like void cout(unsigned char value) { mov a, value acall cout }You would be far better off doing it directly in assembler! The simplest way to create a Keil C51-callable assembler routine is to create a "skeleton" in 'C', then use the compiler with the SRC direcive to contert that to assembler source. See: http://www.keil.com/support/m...51_src.htm You know for sure that this assembler source will be fully compatible with C51, because it was created by the C51 compiler itself! You can now throw away the initial 'C' skeleton, and work on the assembler file in assembler... |