Dave Tweed wrote: >> Didn't say that it should substitute it or that you should try to reverse >> engineer anything from it, did I? > > Sure looked like it to me! You wrote: > >> That's one way. Another way is to ... > > This usually implies that instead of doing the first way (RTFM), you > do only the second way (look at the compiler output). Sorry... it seems I didn't make myself clear enough. As I read it, Olin gave two advices: RTFM (which I assumed as being the obvious thing and not needing any comment) and then how to proceed and integrate assembler code with C code. Olin: >> It describes how arguments are passed to/from subroutines. You >> do whatever it says in assembler. To me it seemed that Olin was talking about integrating assembler code as pure assembler files, where the assembler code creates everything that's necessary to integrate with the C generated code. This includes the calling conventions (calling assembler routines from C and calling C functions from assembler), but includes a lot more that needs to be taken care of (most notably the linker commands). You would have in your project C files and assembler files with public symbols and link them together. That's what I called "one way". What I called "another way" is that you create C files with rudimentary C function bodies (that declare the arguments and local variables in C) and put your assembler code inside the C function body. This has the advantage that you can use the compiler's help with documenting and checking the function arguments with all callers, allocation of local variables, call tree creation, generating the appropriate linker commands and so on. Depending on what you are doing in the assembler code, this may be easier than creating everything in assembler. You also can switch between assembler and C and do whatever is more convenient or efficient in either part. In the project you only have C files, some of which contain any amount of assembler in their function bodies. The rest (creating example code and analyze it) was not meant to be part of the "one way ... another way" thing. There is no "other way" to RTFM :) Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist