Made to Order Software Corporation Logo

Logical Or

SWF Action
Action Category: 
Logical and Bitwise
Action Details: 
0
Action Identifier: 
17
Action Structure: 
<n.a.>
Action Length: 
0 byte(s)
Action Stack: 
pop 2 (b), push 1 (b)
Action Operation: 
b1 := pop();
b2 := pop();
r := b2 || b1;
push(r);
Action Flash Version: 
4

Pop two values, compute the Logical OR and put the Boolean result back on the stack.

b1 b2 Result
false false false
true false true
false true true
true true true
Logical OR table

 

IMPORTANT NOTE

If b2 is the result of a function call and b1 is true, then that function should not be called. This action, however, is just that. It expects two Boolean, b1 and b2, on the stack. So to properly implement  the Logical Or in your compiler, you want to test the result of each function call. There is a sample implementation:

call f1       // b1 does not need to come from a function call
duplicate
branch if true, skip
call f2
logical or    // we could also pop just before call f2
label skip:

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Syndicate content