Quantcast
Channel: nesdev.org
Viewing all articles
Browse latest Browse all 776

How does the PLP instruction works?!

$
0
0
Hi guys, I was review a CPU 6502 spec, and encountered some doubts about the PLP instruction.

As example:
def test_plp(self):
self.cpu_push_byte(0xFF)
self.cpu_pc(0x0100)
self.memory_set(0x0100, 0x28)

self.execute()

self.assertEqual(self.cpu_register('P'), 0xCF)


Given that I push the 0xFF byte to the stack, when I execute PLP (0x28), what would be the value in the status register?

By the documentation that I read, B flag and the unused flag must not be effected when sended to the status.
Is that accurate? Anyone can tell how the real hardware would perform?

Statistics: Posted by gutomaia — Wed May 01, 2024 8:08 am — Replies 0 — Views 6



Viewing all articles
Browse latest Browse all 776

Trending Articles