Subj : Magic smoke update To : Spectre From : Bob Worm Date : Sat Oct 14 2023 20:45:58 Re: Magic smoke update By: Spectre to Bob Worm on Sun Oct 15 2023 02:56:00 Hi, Spec. > BW> "IF a% AND 2 = 0" > Woah, I've never seen a statement that looks remotely like that in any > version of basic. In fairness though most of what I've seen are either MS > variants including Applesoft, or some early TRS80 versions. Well youp piqued my interest... so I tried a couple of other BASICs: **** COMMMODORE 64 BASIC V2 **** READY. A% = 1 READY. IF A% AND 2 = 0 THEN PRINT "YES" READY. IF (A% AND 2) = 0 THEN PRINT "YES" YES So C64 has the same behaviour as the Acorn. I'm pretty sure that's based on MS BASIC - Didn't Bill Gates hide an Easter egg in the PET? Microsoft QBasic ================ a% = 1 IF a% AND 2 = 0 THEN PRINT "Yes" ELSE PRINT "No" No IF (a% AND 2) = 0 THEN PRINT "Yes" ELSE PRINT "No" Yes So QBasic works the same as BBC & Commodore BASICs as well... Atari 8 bit BASIC ================= No bitwise operators :( Applesoft BASIC =============== No bitwise operators (apparently earlier versions had bitwise AND / OR / etc but they were replaced by logical AND / OR / etc). Python 3 ======== >>> a = 1 >>> if(a & 2 == 0): .... print("Yes") .... Yes Hmm... so Python works how I expected - but to be fair 1) it's not a BASIC, and 2) the docs say bitwise operators are always done before comparison. I'm kind of surprised to see bitwise operators missing from so many 8 bit BASICs - I thought that's how we got things done in those days? Then again, they all allow you to poke machine code into memory and run it... so maybe that's the approach. How exciting :) BobW --- SBBSecho 3.20-Linux * Origin: >>> Magnum BBS <<< - bbs.magnum.uk.net (21:1/205) .