Re: A83: Re: Negative or positive?


[Prev][Next][Index][Thread]

Re: A83: Re: Negative or positive?






In accordance with the prophecy, Harper Maddox uttered:

> 
> When coding assembly, you have to scrap alot of techniques that worked well
> for Basic, such as adding a positive or negative number to increment a
> value.
> 

No, those techniques will work fine. If you have a coordinate (say, 42) and
add -1, you get 42 + 255 = 297, which is 100101001 in binary notation. Only
the rightmost 8 bits are kept, though, and they are 00101001, which is 41.
Tadaa!

Linus
============================================================================
            I'm not a complete idiot - several parts are missing.
============================================================================
lairfight@softhome.net, visit http://linusworld.cjb.net (PGP key available).



Follow-Ups: References: