Above & Below

Programming, for all ages and all languages.
Post Reply
sweetgum
Member
Member
Posts: 37
Joined: Thu Sep 18, 2008 11:17 pm

Above & Below

Post by sweetgum »

Are these synonyms for greater then or less then? If not what do they mean?
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Above & Below

Post by bewing »

Not precisely. The difference involves signed vs. unsigned values.

If you put the value 0xdfa87590 into a 32bit register, and CMP it with 0:
"above" will be true (because we are looking at an unsigned value)
but "greater" will be false, because 0xdfa87590 is a negative (signed) number.

The synonym for greater is "not less or equal".
The synonyms for "above" are much more complicated, since they involve both "below" and "carry" (carry is a synonym for below).
CodeCat
Member
Member
Posts: 158
Joined: Tue Sep 23, 2008 1:45 pm
Location: Eindhoven, Netherlands

Re: Above & Below

Post by CodeCat »

To say it more compactly: above/below is for unsigned values, greater/less is for signed values.
Post Reply