We're looking for your comments on how to best organize the wiki's content.

BOR

(Difference between revisions)
Jump to: navigation, search
(Added mnemonic)
(Usage: added truth table)
Line 6: Line 6:
  
 
<code>BOR</code> performs a bitwise OR on <code>arg1</code> with <code>arg2</code> and stores the result in <code>arg1</code>. That is, the bits equal to 1 in either <code>arg1</code> or <code>arg2</code> become 1 in the result; all other bits are set to 0.
 
<code>BOR</code> performs a bitwise OR on <code>arg1</code> with <code>arg2</code> and stores the result in <code>arg1</code>. That is, the bits equal to 1 in either <code>arg1</code> or <code>arg2</code> become 1 in the result; all other bits are set to 0.
 +
 +
{| class="wikitable"
 +
|+ Truth table for
 +
|+ Y(A, B) = A BOR B
 +
|-
 +
! Input A !! Input B !! Output Y
 +
|-
 +
| 0 || 0 || 0
 +
|-
 +
| 0 || 1 || 1
 +
|-
 +
| 1 || 0 || 1
 +
|-
 +
| 1 || 1 || 1
 +
|}
  
 
===Signing dependence===
 
===Signing dependence===

Revision as of 20:13, 13 July 2012

BOR (Bitwise OR) is one of the opcodes in the DCPU-16 specification. It represents a bitwise OR operation.

Contents

Usage

 BOR arg1, arg2

BOR performs a bitwise OR on arg1 with arg2 and stores the result in arg1. That is, the bits equal to 1 in either arg1 or arg2 become 1 in the result; all other bits are set to 0.

Truth table for Y(A, B) = A BOR B
Input A Input B Output Y
0 0 0
0 1 1
1 0 1
1 1 1

Signing dependence

BOR works correctly with both signed and unsigned numbers.

Processing

In binary machine code, this Basic opcode's five-bit representation is: 0b0 1011 (0x0b)

The instruction has a takes one cycle to execute, plus any additional cycles necessary to evaluate the arguments.

References

Personal tools
Namespaces
Variants
Actions
Navigation
Community
Toolbox