piclist 1999\05\04\034534a >
Thread: Inverting binary word
www.piclist.com/techref/index.htm?key=inverting+binary
flavicon
face BY : Dr. Imre Bartfai email (remove spam text)



Hi,
use
       COMF    TANKOD,F
or
       COMF    PORTB,W
       MOVWF   TANKOD

I hope this helps.
Imre


On Mon, 3 May 1999, Andreas Magnusson wrote:

> Hello all!
>
> I have a problem. I am programming a PIC. In the program I load a value from p
ortb to the register TANKOD. The value from portb tell me wich button that is pr
essed down on a keypad. If button 3 is pressed, 3 will be the value of portb.
>
> My problem is that the keypad use "negative logic" or something like that. A 0
is a 1 and a 1 is a 0. So i want to invert the register.
>
> 11111100    =>    00000011
>
>
> Any Idea how I can do this in a easy way.
>
>
> Tnx    /Andreas Magnusson
>

<Pine.LNX.3.96.990504094513.216A-100000@prof.pmmf.hu>

In reply to: <001001be95a2$cd3696e0$939f143e@a010010169>
See also: www.piclist.com/techref/index.htm?key=inverting+binary
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Inverting binary word

month overview.

new search...