This line isn’t right:
this.statusRegister.negative = u8(result !== 0);
It should be checking result & 0x80 or something.
result & 0x80
This line isn’t right:
It should be checking
result & 0x80
or something.