Michael Watterson wrote: >> Second, there is no artificial lengthening when a branch is not >> taken. The only conditional "branch" instructions are the SKIPs. >> These take two cycles when skipping since that changes the PC. When >> not skipping, they take one cycle. For example, the combination of >> a skip followed by NOP always takes 2 cycles, whether the skip >> condition is true or not. > > But look at the datasheet. > > PIC16F87x datasheet You copied a lot of stuff from the datasheet, but it all agrees with what I said as far as I can tell. Note also that we were talking about the 14 bit core. The 16 bit core (PIC 18) does have more conditional instructions including some conditional branches. It also has a small number of non-branching 2 word instructions, but I still don't see how any of this refutes what I said. > *If the first word is skipped for some reason and the second word is > executed by itself, a NOP is executed instead.* Right. First this only applies to the 16 bit core since the 14 bit core has no two word instructions. However, even in this case the NOP they are referring has nothing to do with artifically lengthening a skip. All PIC 18 two word instructions are encoded such that the second word if taken by itself is a NOP. This allows two word instruction to be used as targets of SKIPs. The skip instructions conditionally skips only a a single program memory word. If a two word instruction follows a skip and the condition is true, then the first word of the two word instruction is skipped. The second word is then executed as a stand alone instruction. Since these always code to NOP, no harm is done to the logic flow. The extra NOP executed is due to the two word instruction. It has nothing to do with the skip instruction. > Perhaps I am misunderstanding this? You quoted a lot of stuff, so it's not clear what "this" is. > But I've assumed for years (without checking) that execution time for > skip/branch/test is same whether true or false. I'm not sure what the point is, since your assumptions don't change how the PIC works. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist