Page 2 of 2

Re: ZX80 comparators with negative ressults...

Posted: Sat Nov 20, 2021 1:28 am
by bola_dor
Good..
This is becoming a reference wiky 💪💪

Re: ZX80 comparators with negative ressults...

Posted: Sun Nov 21, 2021 1:25 am
by 1024MAK
As expected, both a Radio Shack TRS-80 Model 100 Portable computer running Microsoft BASIC. And an Amstrad NC200 computer running Z80 BBC BASIC (by R.T.Russel), produce the same results as Microsoft BASIC on a Commodore 64 or PET and Acorn 6502 BASIC.

Mark

Re: ZX80 comparators with negative ressults...

Posted: Sun Nov 21, 2021 11:00 am
by mrtinb
I assume it's because false is all bits zero #00000000 = 0.
And it's true if all bits are one #11111111 = -1.

Re: ZX80 comparators with negative ressults...

Posted: Sun Nov 21, 2021 11:19 am
by 1024MAK
mrtinb wrote: ↑Sun Nov 21, 2021 11:00 am I assume it's because false is all bits zero #00000000 = 0.
And it's true if all bits are one #11111111 = -1.
When using Integer variables and where OR and AND are bit wise operators, yes.

Mark

Re: ZX80 comparators with negative ressults...

Posted: Sun Nov 21, 2021 1:58 pm
by Moggy
I know this is about BASIC comparators but just as pointer for anyone using older versions of Toddy Forth it should be noted that whilst true is represented by -1 in these versions, the new Toddy Forth 79 represents true as 1 as does FIF81 and is not an error on these Forths' part.