Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug, I think
#1
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.
Reply
#2
I don't think NOT works that way anymore...
\__/)
(='.'=) Copy bunny into your signature to
(")_(") help him gain world domination.
Reply
#3
In that context, OR doesn't act as a bitwise operator but as a comparator. Take that in account.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#4
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.
Reply
#5
The problem is that NOT is also bitwise. NOT 2 (10 in binary) = 11111111111111111111111111111101 in binary (in a 32-bit integer).
Reply
#6
*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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)