>Pretty fancy... before long you'll have an all new derived language! Maybe, but think of it more as a case of working out a problem, and then putting the fix in a form that is easy to use. >While I'm learning assembly I think its probably best to stick with >the bsf STATUS,5 type stuff until it sinks in sufficiently, then I'll >write a macro or use banksel to improve readability. Don't waste too much time that way. You will find that it is all too easy to make mistakes in your typing, and send your program off into hyperspace. Then much head scratching takes place, and after a couple of days find the typing error. This is where using macros does save much un-necessary aggravation. >The main reason I'm learning asm is to understand how things work, not >to create complicated high-level programs. I must admit, however, that >I was very suprised to see the very very small amount of space used for >the blinky program in ASM as compared to a similar program compiled from >C code. Maybe I'll be a convert yet... A blinky led program is probably not a good example for comparing code size. It is a bit like a "hello world" program, in that it can be done much simpler in assembly than the amount of machine code the equivalent C source provides. However when you get to larger programs with complicated variable allocation and sharing, then the HLL can shine, and remove some of the easily made mistakes that assemble can give. If you really wish to dig into assembler, I do suggest you look at the development environment available from http://www.embedinc.com/pic/ which is designed around using relocatable modules. Also get the example projects that are available for download there, and pay attention to the installation instructions, as the order of installing them onto your system is important. While this environment may seem a complicated way of doing things, as a HLL programmer you may find it more in line with the way you are used to doing things. By having the code modular, you can have variables which are effectively local to that module, and so you stand a reasonable chance of minimising unwanted interactions between modules. The environment also includes a terrific set of macros, which are worth studying in their own right. Use of these macros can save many hours of head scratching, as many of the bank select ones produce code only if it is really needed, so you can put the macro in as a safety measure, without worrying about code bloat. Welcome to the world of ASM. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu