beautypg.com

Or_r (or and return) – Echelon Neuron User Manual

Page 104

background image

OR_R (Or and Return)

The OR_R instruction performs a logical OR for two numbers and performs a

return-from-call operation. The OR_R instruction uses the implicit addressing

mode. The OR_R instruction retrieves both TOS and NEXT from the data stack

and performs a bitwise logical OR for them. TOS and NEXT are consumed, and

the result is placed in TOS. The operation clears the Carry flag. The return-

from-call operation loads the instruction pointer (IP) with the return address

from the return stack.
The OR_R instruction applies to Series 3100, 5000, and 6000 devices.

Syntax:
The OR_R instruction requires no operands:

OR_R

Table 37 describes the attributes of the OR_R instruction.

Table 37. OR_R Instruction

Instruction

Hexadecimal

Opcode

Instruction

Size (Bytes)

CPU Cycles

Required

Affect on

Carry Flag

OR_R

5E

1

7

Cleared


Example:
The following example performs the operation 2 OR 3 and performs the return-

from-call operation. The example assumes that the return stack contains the

address of the caller to which the OR_R instruction returns.

pushs #2 ; (2, -, -)

pushs #3 ; (3, 2, -)

or_r ; (3, -, -)

The value of TOS after this code executes is 3 because 2 OR 3 = 3. After

completing the logical OR operation, the OR_R instruction performs the return-

from-call operation.

94

Neuron Assembly Language Instruction Statements