[virtmach] instruction set
Stephen Pelc
sfp@mpeltd.demon.co.uk
Thu, 20 Apr 2000 11:05:50 +0100
> Dennis Yelle <dennis51@jps.net> writes:
> > Because this:
> > if ( a < b )
> > is not the same as this:
> > if ( (a-b) < 0 )
>
> In what mathematics?
The results are the same for differences less than half the
total range. If the difference on (say) a 16 bit system is
greater than 2^15, then you need to consider the carry flag as
well. Just comparing the sign of the result is called circular
arithmetic, and it has its uses. However the results are not
always what you would expect, as Dennis' example shows.
--
Stephen Pelc, sfp@mpeltd.demon.co.uk
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 1703 631441, fax: +44 1703 339691
web: http://www.mpeltd.demon.co.uk