Recent Changes - Search:
Email iofreak@yahoo.com with comments and/or suggestions.

Aibo General

Aibo Development

Wiki Help

Aibo Links

R-Code » Boolean/Logic

Boolean & Logic Statements

Perform bitwise and comparison operations. bitwise comparison

Models

ERS-210 ERS-220 ERS-31x ERS-7

OperationSyntaxEquivalent Expression
Bitwise AndAND:var:valuevar = var And value
Bitwise Or (Inclusive)IOR:var:valuevar = var Or value
Bitwise Or (Exclusive)XOR:var:valuevar = var Xor value
Bitwise NegationNOT:var:valuevar = Not(value)
Logical AndLAND:var:valuevar = var And value
Logical Or (Inclusive)LIOR:var:valuevar = var Or value
Logical NegationLNOT:var:valuevar = Not(value)

Example(s)


   LOCAL:x   // declare a local variable x
   LET:x:6   // x = 6 (binary 0110)
   AND:x:2  // x = x And 2 (binary 0010)
   IOR:x:1   // x = x Or 1 (binary 0001)
   PRINT:"x = %d":x // output x = 3 (binary 0011)
 

In addition to the above variable-based operations, stack-based operations are available. In general, stack-based operations are performed by PUSHing operands onto the stack, then calling the desired operation. The operand values are then POPed off the stack, with the result of the operation PUSHed back to the stack.

   PUSH:operand1
   PUSH:operand2
   operation
   POP:result   // result = operand2 operation operand1

OperationSyntaxEquivalentExpression
Bitwise AndANDoperand2 And operand1
Bitwise Or (Inclusive)IORoperand2 Or operand1
Bitwise Or (Exclusive)XORoperand2 Xor operand1
Bitwise NegationNOTNot(operand1)
Logical AndLANDoperand2 And operand1
Logical Or (Inclusive)LIORoperand2 Or operand1
Logical NegationLNOTNot(operand1)
EqualEQoperand2 == operand1
Not EqualNEoperand2 <> operand1
Less ThanLToperand2 < operand1
Less Than or Equal ToLEoperand2 <= operand1
Greater ThanGToperand2 > operand1
Greater Than or Equal ToGEoperand2 >= operand1

Boolean/Logic statement syntax has the following parts:

PartDescription
varThe user defined Variable name.
valueVariable name or constant.
operand1-2Variable name or constant.
resultVariable name or constant.

Example(s)


   LOCAL:x   // declare a local variable x
   LET:x:6   // x = 1 (binary 0110)
   PUSH:2   // place 2 on the stack (binary 0010)
   PUSH:x    // place the value of x on the stack
   AND       // stack value is now 6 And 2
   PUSH:1    // place 1 on the stack 
   IOR       // stack value is now 2 Or 1
   POP:x     // x = top of stack
   PRINT:"x = %d":x // output x = 3 (binary 0011)
 

Edit - History - Print - Recent Changes - Search - Site Terms of Use
Page last modified on February 07, 2006, at 08:57 PM CST