On Friday, March 16, 2007 6:33 PM [GMT-3=3DCET], James Newton, Host wrote: > > I don't think you need to clear the carry first. Also, you > > can test for zero by moving a byte of ram to itself. Your > > code becomes... > > > Ahhh, the true reason for the PICList. > > Are we down to 12 instructions yet? James, I gave up at 15,... without counting delay calls. ;Dollar Sign $ =B7=B7=B7-=B7=B7- sign test movlw B'00010011' ; 0 =3D DASH 1 =3DDOT movwf MorseChar ; last "one" is a stop bit LOOP BCF PORTB,5 ; STOP BIT BCF STATUS,C ; do not shift "ones" now RLF MorseChar,F ; put 7th bit in C MOVF MorseChar,F ; test if all bits are zeros BTFSC STATUS,Z ; if not, test C GOTO end_of_char ; end character BSF PORTB,5 ; switch on the led (flag;) BTFSS STATUS,C ; is a dash or a dot?SET =3D DASH GOTO DOT ; only one delay DASH ; NOP ; CALL DELAY NOP ; CALL DELAY DOT ; NOP ; CALL DELAY GOTO LOOP ; end_of_char ; Dennis. -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist