On Mon, 13 Jul 1998, Brian Gracia wrote: -snip- > > Where I am lacking is in the fact that while I can program in several > computer languages, pic code is just not the same!!! Can someone help me > by translating some simple program building blocks like IF..Then, Do > While..Loop, For I.., etc into pic code. I need to see these in order to > get a basic footing, and then I can begin to understand. Doing this is > like showing someone how to read a tape measure. Pretty soon, with a set > of plans (psudo code), and the basic building blocks, they can build a > house. Well almost, but you get my drift. Since you already know a few other languages, analyze how you picked the(m) up. Do you learn best by yourself, in class, from an organized course, or are you the kind that rips things apart to learn what's inside ? Then, pick a learning method that suits you best. A book is a good start, if you are that kind of guy. If you learn by yourself, simply learn the instruction set by heart and start doing some simple applications (peek at the application notes from Microchip in the process). If you like to program using templates, get a book. The author usually uses his own programming style throughout, and that is as good a 'template' as any. Translating structured programming constructs into PIC assembly is not so direct as you might think it is. For example for an IF...THEN...ELSE you would have to work out an expression for the IF part that sets a bit or a register and write code like this: ; IF ; code for if-expression here ; final comparison: ZF of the PSW is not set IF true (C convention) btfsc PSW, ZF goto if_false ; THEN ; code for true case here goto if_end ; ELSE if_false: ; code for false case here if_end: ; FI Notice that there is no boilerplate code, only the structure of the code is essential. You have to find a solution for every case as you go, there is no real constraint in a symmetrical-register architecture machine as the PIC is. DO..WHILE etc translate much in the same way. You keep the general structure of the construct, but you implement it with the mnemonics that get you to your goal. Putting labels with structured construct part names in them into the source will help you understand the code later. Notice that remarkably few advanced assembly programmers bother about structured code construction on PICs ;) Hack mode is much more natural hope this helps, Peter