Re: LZ: On subject of 2's complement format...
[Prev][Next][Index][Thread]
Re: LZ: On subject of 2's complement format...
On Wed, 09 Jul 1997 23:09:07 -0400, you wrote:
>Okay... NEG results in the 2's complement of a number. This is
>basically the number*-1, if I am not mistaken. Can someone
>verify this instruction, as it would make my current project
>( a new driver for the temp sensor ) a lot easier when dealing
>with negative temperatures.
>
NEG will reverse all the bits and *add* 1. so if register a has 1h
(0000 0001b), the complement (CPL) of it would be FEh (1111 1110b),
and the NEG would be the complement plus 1, FFh (1111 1111b). So FFh
is -1 in 2's complement form.
-mike
References: