Starting from Scratch (was Re: OT: Modern college educa

From: Pete Turnbull <pete_at_dunnington.u-net.com>
Date: Sat Oct 24 13:27:15 1998

On Oct 24, 9:53, Sam Ismail wrote:
> Subject: Re: Starting from Scratch (was Re: OT: Modern college educa
> On Fri, 23 Oct 1998, Ethan Dicks wrote:
>
> > can provide one. It depends on logical statements working as follows:
> > The statement C=(A>B) would set C to 0 if A weren't greater than B, and
> > would set C=-1 if A were greater than B. Not all micro BASICs support
this.
> > I'm pretty sure Applesoft is onethat does _not_.
>
> AppleSoft would logically return a +1 for the above statement rather than
> a -1. Why the PET returns a -1 is beyond me. Couldn't they have added
> one more machine instruction to strip off the sign bit?

The PET is actually following the more common convention. The bitwise
complement of 0 (all zero bits) is -1 (all one bits), at least in a
2's-complement environment.

-- 
Pete						Peter Turnbull
						Dept. of Computer Science
						University of York
Received on Sat Oct 24 1998 - 13:27:15 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:31:28 BST