I write every single PIC program I ever have done in assembler. The only time I use C compilers is when there is something that is easily done in C, which is quite complicated in assembler - in some cases it's useful to use the C compiler and check the output assembler to see how it's done. However, when working on computer programs (i.e. x86), I always use C or visual basic - I have never found a good reference for 32bit assembler. On 6/11/05, Gerhard Fiedler wrote: > Matthew Miller wrote: > > > I would also suggest that since you are just learning the CCP module, > > debugging, and such; to write your test program in assembly and not C. > > This will make it easier for others to help you and improve your > > learning. Once you have things straightened out you could switch back to > > C. :) > > This is definitely a possible approach, probably good for some, but > possibly not the best for all... :) > > [Before you flame me, please consider this :) The following is not a > C-vs-Assembler discussion, as far as development environments go. I'm very > well aware that both have their place, within project, company and > individual preferences and requirements. It is a reply to the point made > that it is helpful to write an assembler program when the desired target > environment is C.] > > I would stick to C. If you have a decent compiler, you can rely on the > infrastructure to work and you don't have to worry about it all (startup > code, interrupt entry/exit code, memory banks, code pages). Considering > that C is your target environment, there's really not much of a point to > get deeper into those issues, other than knowing what it is about and being > able to read and understand what the compiler does with that. Which is > somewhat different from programming it yourself in assembler. > > I know that there are many people here who use only assembler, and maybe > it's easier to tap into their experience when using assembler. OTOH the > code you presented is probably readable for an assembler programmer just as > well. > > I haven't written a single assembler program for the PIC. I have written a > number of assembler code parts, but not many, and always within the > framework of a C program. I have never found a problem that would require > me to write an assembler program to tackle it -- or even that would make it > easier to find in an assembler program. I prefer the ease of use of C, > especially for debugging problems. Since C is my target environment, I have > my debugging aids in that environment. Of course, I have found a number of > bugs (in both my code and in the compiler) by looking at (and > understanding) the assembler code in the compiler-generated list files. > > ------------------------------------------ > > Just out of curiosity: There are programmers who only work in assembler. > There are programmers who only work in C (or Jal or Basic or whatever > semi-high level language). There are programmers who work mostly in C (or > whatever semi-high level language) and some in assembler. > > But are there programmers who work mostly in assembler and only some in a > semi-high level language like C? I would think not, but I'd like to hear if > there are -- and why they're doing it this way. > > Gerhard > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- Dave All us base are belong to you. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist