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

unit test for php

This commit is contained in:
Sam M W 2023-10-29 14:03:05 +00:00
parent 4d2621d603
commit c6a143a34a

View File

@ -1154,6 +1154,16 @@ mod tests {
assert!(cpu.registers.status.contains(Status::PS_CARRY));
}
#[test]
fn php_sets_bits_4_and_5() {
let mut cpu = CPU::new(Ram::new());
cpu.execute_instruction((Instruction::PHP, OpInput::UseImplied));
cpu.execute_instruction((Instruction::PLA, OpInput::UseImplied));
cpu.execute_instruction((Instruction::AND, OpInput::UseImmediate(0x30)));
assert_eq!(cpu.registers.accumulator, 0x30);
}
#[test]
fn and_test() {
let mut cpu = CPU::new(Ram::new());