The binaryORoperation has two inputs and one output. It is like theADDoperation which takes two arguments (two inputs) and produces one result (one output).The inputs to a binary

ORoperation can only be0or1and the result can only be0or1The binary

ORoperation (also known as the binaryORfunction) will always produce a1output if either of its inputs are1and will produce a0output if both of its inputs are0.If we call the inputs

AandBand the outputCwe can show theORfunction as:

ABC0OR0->00OR1->11OR0->11OR1->1The PIC machine code

ORinstruction operates on 8 sets of inputs and outputs in parallel.If we

ORtwo input bytes together on the PIC we get an output byte. If we give each bit within a byte a number we can see that each bit in the output is the result of theORfunction on two corresponds bits of the inputi.e.

So if we have two binary numbers

A_{7}A_{6}A_{5}A_{4}A_{3}A_{2}A_{1}A_{0}B_{7}B_{6}B_{5}B_{4}B_{3}B_{2}B_{1}B_{0}C_{7}C_{6}C_{5}C_{4}C_{3}C_{2}C_{1}C_{0}00100100and00100001we can see the effect ofORing these two sets of 8 bits in parallel.e.g.

argument 1 00100100argument 2 00100001result 00100101The input bits

Aand_{5}Band the output bit_{5}Care here shown in red_{5}The input bits

Aand_{2}Band the output bit_{2}Care here shown in green_{2}The input bits

Aand_{1}Band the output bit_{1}Care here shown in yellow_{1}The input bits

Aand_{0}Band the output bit_{0}Care here shown in blue_{0}In XCSB the binary

ORoperator works in the same way, operating in parallel on sets of inputs and outputs within a variable or constant.If we assign the value

0x24to the variableJ, which is the hexadecimal equivalent of the binary value00100100, the value0x21to the variableKwhich is the hexadecimal equivalent of the binary value00100001and then perform the XCSBORoperation onJandKand assign the result toM. The value stored inMwill be0x25which is the hexadecimal equivalent of the binary value00100101Written as XCSB source code this would be:

J = 0x24 K = 0x21 M = J | K