> Thanks very much! Your help is much appreciated. I've got > everything working now and I was trying to see what i could > do in asm so here's the new code below that does the same > thing, but i think is a bit neater Getting that first one running is always a big step and very satisfying. Plus it's something to build on. A couple of minor things > decfsz CounterB,1 could / should be written as "decfsz CounterB,f". The default is "f" so "decfsz CounterB" will work. A lot of 0's and 1's in code may prove to be confusing one day. Stick to f and w > bsf STATUS,0 ;changes carry bit, etc "carry" and "zero" can be defined, #define carry status,0 so you could use eg btfsc carry, or "skpnc" is an alternative Have a look in Help/MPASM Assembler Help (path depends on what version of MPLAB you're running). And check out 16F877.inc (just load it into MPLAB or any WP) to see what labels / bits and mathematical operators are already defined or acceptable shortcuts Happy late nights ! -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics