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:
parent
4d2621d603
commit
c6a143a34a
10
src/cpu.rs
10
src/cpu.rs
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue
Block a user