Thanks Olin, I see your point.. Hi All,=20 I'm new to PICs and am trying to "port" my Z80 assembler skills to something that belongs in this century but am having problems with my test program. Here it is: LIST p=3D16f877,c=3D140 include "p16f877.inc" org 0 clrf STATUS goto BootStart org 4 ISR goto 5 ; Setup Interupt Address org 5 BootStart clrf PORTB bsf STATUS,RP0 ; set RAM Page 1 for TRIS registers movlw b'00000000' movwf TRISB ; set PORTB for all outputs bcf STATUS,RP0 ; back to RAM page 0 LoopAgain ;movlw 0x00 ;movwf PORTB ; All PORTB bits off ;movlw 0xFF ;movwf PORTB ; All PORTB bits on incf W, 0 ; W =3D W + 1 movwf PORTB ; PORTB =3D W goto LoopAgain end=20 Now I thought that 'incf W, 0' would perform a W=3DW+1 operation, and = that when it reached 255, it would simply start from 0 (since it's an 8-bit register), but this doesn't seem to be the case. If I use the 4 commented lines instead of the 3 lower ones, then I get a nice square wave on all 8 I/O pins, so I know the PIC is working and that my programmer is ok etc. All I expect the above test program to do is count in binary flashing 8 LEDs.... So what stupid thing am I doing wrong... Any help much appreciated, Joe -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads