On Thu, 2006-03-02 at 02:44 +0000, Will wrote: > Is it possible for the C18 compiler to generate assembly > listings from the compiled C code? I know gcc and MS VC > do have such an option. If you wanted to know why I want > this, it is simply to better understand the C samples, e.g. like > > rom struct.... what is rom keyword > ram struct... what is ram keyword > extern volatile far BDT ep0Bo what is far, what is volatile Not really sure how getting an asm listing will really help in trying to figure out the features of a compiler directive. rom means that struct will be physically located in the PIC's ROM (i.e. program) space. ram means that struct will be physically located in the PIC's RAM space. Remember that the PIC architecture defines completely seperate address spaces for ROM and RAM. Most PIC compilers assume certain things when deciding whether something belongs in ram or in rom. Code obviously belongs in the "rom" space, and usually your variables belong in the ram space. But there are cases where it is beneficial to put "variables" that don't change into rom space. A good example are strings. Strings are often unchanging in the flow of a program, and can easily eat up all your RAM. By specifying "rom" you are telling the compiler to generate code that places the string in ROM, and accesses to that string use ROM techniques (i.e. retlw). Many compilers will force you to specify that anything put in the "rom" space is "const". extern means that function uses that "object", but the definition is "elsewhere". far deals with the "memory model" used by the compiler, far usually means something like "you have to use more bits to represent the location of this object". Again, this usually is a result of calling a function from a file which doesn't contain that function. > are all these explained somewhere? The C18 manual would be the clear first choice of looking things like this up, especially things like rom and ram. The extern and far is probably also described in more general C books. ----------------------------- Herbert's PIC Stuff: http://repatch.dyndns.org:8383/pic_stuff/ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist