ALU Logic

Opcodes

OpcodeActionFlagsDescription
NOPPC ++No operation and will increase the PC counter by 2
AND Rx,#Rx <= Rx & ImmZRx is ANDed with an Immediate 16 or 32 bit value and the result is placed back into Rx.The Z flag is set if the result is zero.
OR Rx,#Rx <= Rx | ImmZRx is ORed with an Immediate 16 or 32 bit value and then result placed back into Rx.The Z flag is set if the result is zero.
XOR Rx,#Rx <= Rx ^ ImmZRx is XORed with an Immediate 16 or 32 bit value and then result placed back into Rx.The Z flag is set if the result is zero.
BIT Rx,#Z <= Rx & ImmZRx is ANDed with an immediate 16 or 32 bit value, but the result is not written back.This allows testing bits in a register without changing the register's value.The Z flag is set if the result is zero.
AND Rx,RyRx <= Rx & RyZRx is ANDed with Ry and the result placed back into Rx.The Z flag is set if the result is zero
OR Rx,RyRx <= Rx | RyZRx is ORed with Ry and the result is placed back into Rx.The Z flag is set if the result is zero
XOR Rx,RyRx <= Rx ^ RyZRx is XORed with Ry and the result is placed back into Rx.The Z flag is set if the result is zero.
BIT Rx,RyZ <= Rx & ImmZRx is ANDed with Ry but the result is not written back.The Z flag is set if the result is zero.
CRC Rx,Ry,Rz,#nCRC Rx,Ry,Rz,#nCRC16's data in RAM at Rx for length Ry using Rz for the CRC accumulator, and polynomial N.

Notes

  • Z Flag used for result is zero
  • C Flag used for overflow on ALU