
The operations are applied to the input ports A and B (port A is the lower half byte of the digital inputs and port B is the upper half byte) and output to the lower half byte of the digital outputs. On the upper half byte of the outputs, the mini status register is found, with the usual flags (carry, zero, negative and overflow). The bidirectional pins are all declared as inputs, with the first bit for the subtract signal and the following four bits for the operation selection. If an unary operation (e.g. the ones complement) is performed, port A is usually used. Only exception is the twos complement, where port B is used. The output mux selects the operations in the following order, starting from 0: Add and subtract (depends on the subtract mode), and, or, xor, ones complement, shift left (same for arithmetic and logic shift), shift right arithmetic, shift right logic, rotate left, rotate right, rotate left through carry and finally rotate right through carry.
The digital inputs are divided in a lower and an upper half byte. Set the lower half byte to some number and do so with the upper half byte. Select an operation with the operation selection mux (bits 1 to 4 of the bidirectional pins). Choose the operation from the list in the previous section. If nothing is selected, the add/subtract mode is selected by default. The result of the operation is displayed at the lower half byte of the digital outputs. The upper half byte holds the flags. Be aware that most of the operations don't utilize them. They are only used in the add/subtract mode and the rotate through carry mode. When in add/subtract mode, the pin 0 of the bidirectional pins indicates whether to perform addition (low) or subtraction (high). To get the twos complement, use subtraction mode and subtract form 0 (port A is set to 0).
Not used.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | Port A bit 0 | result of the operation bit 0 | subtract mode on |
| 1 | Port A bit 1 | result of the operation bit 1 | output mux bit 0 |
| 2 | Port A bit 2 | result of the operation bit 2 | output mux bit 1 |
| 3 | Port A bit 3 | result of the operation bit 3 | output mux bit 2 |
| 4 | Port B bit 0 | Carry flag | output mux bit 3 |
| 5 | Port B bit 1 | Zero flag | |
| 6 | Port B bit 2 | Negative flag | |
| 7 | Port B bit 3 | Overflow flag |