Posts: 357
Threads: 118
Joined: Oct 2004
temp2 = 2
if not(temp1 or temp2 or temp3 or temp4 or dummy -> x or dummy -> x2) then
print "hello"
end if
for some reason this prints out "hello"
logically there is no values that would make that if statement true, right? I believe that those are bitwise OR statements. 2 OR x is can never be false.
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Posts: 719
Threads: 42
Joined: Oct 2005
I don't think NOT works that way anymore...
\__/)
(='.'=) Copy bunny into your signature to
(")_(") help him gain world domination.
Posts: 6,419
Threads: 74
Joined: Mar 2002
In that context, OR doesn't act as a bitwise operator but as a comparator. Take that in account.
Posts: 357
Threads: 118
Joined: Oct 2004
Oh, then what does that OR statement do? I always though anything nonzero was true and true OR anything was always true. How do I change it to do what I want it to do? I want it to simply return false if any of the values are non zero.
EDIT: Does this still work the way I want?
Code:
temp2 = 2
asm
mov eax, [temp1]
or eax, [temp2]
or eax, [temp3]
or eax, [temp4]
or eax, [dummy -> x]
or eax, [dummy -> x2]
mov [temp1], eax
end asm
if not (temp1) then print "hello"
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Posts: 1,439
Threads: 15
Joined: Apr 2003
The problem is that NOT is also bitwise. NOT 2 (10 in binary) = 11111111111111111111111111111101 in binary (in a 32-bit integer).
Posts: 357
Threads: 118
Joined: Oct 2004
*smacks head* I've been doing too much programming in languages with boolean types. I gotta get my head back in the game.
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.