Test instruction does not clear carry bit. alu_tst declared but never used, alu_st8 is used for the test instruction but it does not affect the carry bit. Fix: use alu_tst for the test instructions and have it clear the carry bit.