RE: [bascom] An unfair bug in BASCOM 8051 V. 2.0.3.0


From "Mark Alberts" <mark@mcselec.com>
Date Fri, 15 Dec 2000 23:06:09 +0100

Hi,

The math was designed so that all 3 params must be of the same kind.
For example when you want a word calculation, the target and one of the
source variables must be of the word type.

For the different data types, different routines are used.
But probably long time ago a user wanted to assign a long with a source byte
so I added this. It is indeed not consistent.
For a newer compiler in the works, I will implement the normal qb type cast.

Best regards,
Mark Alberts

> -----Original Message-----
> From: owner-bascom@grote.net [mailto:owner-bascom@grote.net]On Behalf Of
> Udo Barthel
> Sent: donderdag 14 december 2000 19:08
> To: 'Bascom (E-Mail)
> Subject: [bascom] An unfair bug in BASCOM 8051 V. 2.0.3.0
>
>
> Error in Multiplication if the result is in the value range of a long
> variable:
>
> LONG = BYTE * CONST ... works o.k.
> LONG = WORD * CONST .... gives bad results
>
> Its obvious that the math is not performed in the value range of
> the target
> variable if a word variable is used. But why does it seems to work with a
> byte variable? Thats inconsistent.
>
>
> _____________________________
>
> With  best regards / Udo Barthel
>
> The statements and opinions expressed here are my own and do not
> necessarily
> those of PCDS software GmbH.
>
> visit us at <http://www.pcds.de>
> Phone: +(30)41.09.02-0 Fax: -99
>
>