IF Boolean_Logic = Inconsistent Then IsBug()

BlitzMax Forums/BlitzMax Programming/IF Boolean_Logic = Inconsistent Then IsBug()

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I used to code in assembly language.
Sure.

There is no boolean in ASM
There are actually. The CPU has a bunch of flags (on the Intel x86 stored in the flag register), that holds the current state of the CPU. Every one of those flags is boolean. Either true or false, set or reset. These flags are manipulated by certain instructions, like shifting and adding for instance will effect the "Carry" and "Overflow" flags, CMP (compare) will effect the "Zero" flag Defoc8 was talking about, subtracting the two values it takes as parameters and modifying the flagregister depending on the result. If the result is Zero (ie both numbers are equal) then the Zero flag is set and the next jz (jump if zero) or jnz (jump if not zero) will act accordingly.

Disallowing conversion from Int to Boolean would be something done at compile time.
Ints are not being converted to booleans.

I don't know why it has persisted this long.
Because no-one has created a computer that can read your mind yet. A computer will do what you tell it to, not what you think you tell it to.