The 6516 contains an ALU capable of performing arithmetical and logical operations on one or two data inputs. The ALU is also capable of returning flags which can indicate the outcome of an operation.
The ALU consists of the following input buses:
carry
into the ALU)Two output buses:
The following operations are supported by the ALU:
The ALU has four flags: ZERO
, CARRY
, OVERFLOW
and NEGATIVE
, arranged as follows on the flags-out
bus:
0 - ZERO
1 - OVERFLOW
2 - CARRY
3 - NEGATIVE
These are set after each operation — it is up to the CPU to decide if it should pull these values into the FLAGS
register.