Thanks for you reply Andrew, Paul has send me another example: DATA_1: SETC ; Carry is 1 GOTO D0_2 DATA_0: CLRC ; Carry is 0 D0_2: RLF DATA,F ; Ripple carry in. Wish I'll try first, but although thanks for the reply! Joep Schroen ----- Original Message ----- From: Andrew Warren To: Sent: Monday, April 17, 2000 12:46 AM Subject: Re: Shifting in Software > Paul B. Webster VK2BZC wrote: > > > > I've got a problem, I need to make a shifting register in software. > > > > Arrange your receiveing line so that it corresponds to one end or > > other of a register, e.g., PORTA.0 then to shift a bit from that > > into DATA, use: > > > > RRF PORTA,W ; Ignore W, it's the carry we want > > RLF DATA,F ; This time, it ends up back in the register. > > Paul: > > That's fine, except that he needs the bits to shift into the register > the OTHER way: > > RRF PORTA,W > RRF DATA > > Joep: > > If you don't want to be forced to put your input on the edge of a > port, you can put it on ANY port pin and do this: > > #DEFINE INPUT PORTA,2 ;or any other port. > .... > CLRC > BTFSC INPUT > SETC > RRF DATA > > After you've executed the above code 8 times, your "DATA" register is > full and you can copy it to wherever it needs to go. > > -Andy > > > === Andrew Warren - fastfwd@ix.netcom.com > === Fast Forward Engineering - San Diego, California > === http://www.geocities.com/SiliconValley/2499 >