Constructs a new instance from the given arguments.
The EFLAGS register of the CPU core this ALU is associated with.
This method adds two given binary numbers while taking the carry into account.
Affects the sign, zero, carry, overflow and parity bit according to the result.
The first operand/summand.
The second operand/summand.
The sum of both operands/summands.
This method adds two given binary numbers without taking the carry into account.
Affects the sign, zero, carry, overflow and parity bit according to the result.
The first operand/summand.
The second operand/summand.
The sum of both operands/summands.
This method performs an bit-wise, logical AND operation on two given binary values, according to the following table.
Bit x | Bit y | Result |
---|---|---|
0 | 0 | 0 |
1 | 0 | 0 |
0 | 1 | 0 |
1 | 1 | 1 |
Both the carry and the overflow flag are cleared, while the zero, sign and parity flags are set or cleared according to the operations result.
The first doubleword.
The second doubleword.
The resulting binary value.
This method performs an arithmetic shift on the given binary value one bit to the right.
The operand to perform a right shift on.
The bit right shifted.
This method compares both given binary values, by performing a subtraction.
Affects the sign, zero, carry, overflow and parity bit according to the result.
In contrast to SUB, this operation does not effect the second operands value.
This method divides both the given binary, doubleword sized values.
Affects the sign, zero, carry, overflow and parity bit according to the result.
The first operand, which divides the dividend.
The second operand, which gets divided by the divisor.
The resulting quotient.
This method performs an arithmetic shift on the given binary value one bit to the left.
The operand to perform a right shift on.
The bit left shifted.
This method performs an arithmetic shift on the given binary value one bit to the right.
The operand to perform a right shift on.
The bit right shifted.
This method multiplies both the given binary, doubleword sized values using Booths mulitplication algorithm, according to https://medium.com/@jetnipit54/booth-algorithm-e6b8a6c5b8d.
Affects the sign, zero, carry, overflow and parity bit according to the result.
The operand, which determines, how often the first operand gets multiplied.
The operand, which gets multiplied by the multiplicand.
The resulting product.
This method computes the two's complement of the given binary value.
Both the carry and the overflow flag are cleared, while the zero, sign and parity flags are set or cleared according to the operations result.
The operand.
The two's complement.
This method performs the logical NOT operation bit-wise on a doubleword sized binary value. All its bits will be inverted: 1 becomes 0 and vice versa.The result corresponds to the one's complement of the given binary value.
All flags remain unchanged.
The doubleword sized binary value to invert.
The inverted binary value.
This method performs an bit-wise, logical OR operation on two given binary values, according to the following table.
Bit x | Bit y | Result |
---|---|---|
0 | 0 | 0 |
1 | 0 | 1 |
0 | 1 | 1 |
1 | 1 | 1 |
Both the carry and the overflow flag are cleared, while the zero, sign and parity flags are set or cleared according to the operations result.
The first word.
The second word.
The resulting binary value.
This method subtracts two given binary numbers without taking the carry into account.
Affects the sign, zero, carry, overflow and parity bit according to the result.
The binary value to subtract from.
The binary value to subtract.
The difference of the first operand (minuend) and the second operand (subtrahend).
This method sign extends a given binary value to the specified length.
A binary value to sign extend.
The lenght to sign extend the operand to.
This method subtracts two given binary numbers without taking the carry into account.
Affects the sign, zero, carry, overflow and parity bit according to the result.
The binary value to subtract from.
The binary value to subtract.
The difference of the first operand (minuend) and the second operand (subtrahend).
This method compares both given binary values, by performing a logical AND operation.
Affects the sign, zero, carry, overflow and parity bit according to the result.
In contrast to AND, this operation does not effect the second operands value.
This method performs an bit-wise, logical XOR operation on two given binary values, according to the following table.
Bit x | Bit y | Result |
---|---|---|
0 | 0 | 0 |
1 | 0 | 1 |
0 | 1 | 1 |
1 | 1 | 0 |
Both the carry and the overflow flag are cleared, while the zero, sign and parity flags are set or cleared according to the operations result.
The first doubleword.
The second doubleword.
The resulting binary value.
Author
Erik Burmester erik.burmester@nextbeam.net