1
0
mirror of https://github.com/mre/mos6502.git synced 2024-12-23 03:29:51 +00:00

Add and().

This commit is contained in:
Andrew Keeton 2014-11-06 19:07:54 -05:00
parent 5e0d151f12
commit 413d063f82

View File

@ -459,6 +459,11 @@ impl Machine {
} }
} }
fn and(&mut self, value: i8) {
let a_after = self.registers.accumulator & value;
self.load_accumulator(a_after);
}
// TODO: Implement binary-coded decimal // TODO: Implement binary-coded decimal
fn subtract_with_carry(&mut self, value: i8) { fn subtract_with_carry(&mut self, value: i8) {
if self.registers.status.contains(PS_DECIMAL_MODE) { if self.registers.status.contains(PS_DECIMAL_MODE) {