looks like the main suspicions are on the "while(B0!=3D1);". It's the first= =20 time i use sdcc but i think it should just cycle until B0 becomes 0 (!=3D1)= ,=20 then quit the loop and go on with the program. I guess since it has a=20 semicolon at end, it should not contain the other while, but rather be a=20 different loop. However i tried to do something like this: while(B0!=3D1){ _asm nop; _endasm } (you never know) and it's the same. For resetting issues:the power is from = a=20 9v battery -> 78ls05 regulator and pin 4 is connected directly to the=20 regulator output. This is how it writes the while in assembler (second=20 version): _00105_DS_ ;#CSRC a.c 24 ; while(B0!=3D1){ BTFSC (_B0 >> 3), (_B0 & 7) GOTO _00109_DS_ nop; GOTO _00105_DS_ Looks like there is no problem here. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist