Skip to content

ALU fixes and refactoring

Johannes Kung requested to merge smaller_files into main

Closes #55 (closed), #45 (closed)

Fixes the bug where the C-flag is not set during subtraction when a borrow takes place. Also fixes some incorrect shift operations. The tests for the ALU have been refactored for readability and updated to thoroughly test each operation, including the expected flag values. The tests have also been checked against the real MIA program to ensure correct behaviour.

Part of issue #54 (closed) and #25. A large substantial refactoring to the ALU has been done to make the ALU class a lot more clear and readable. This includes moving pure arithmetic functions, e.g. binary add and bitwise or, into a separate file with a separate test file. Moreover, documentation in the numpydoc format has been added to the ALU class.

Merge request reports

Loading