1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-05-31 22:41:37 +00:00

Clarify BRK explanation

This commit is contained in:
Andy McFadden 2019-10-29 10:18:48 -07:00
parent 14ecad0849
commit e79064709c
2 changed files with 12 additions and 3 deletions

View File

@ -939,8 +939,12 @@ namespace Asm65 {
Mnemonic = OpName.BRK,
Effect = FlowEffect.NoCont,
BaseMemEffect = MemoryEffect.None,
// On 6502/65C02 this also affects the 'B' flag, which overlaps with X. Nobody
// really cares though. On 6502 this doesn't clear the 'D' flag.
// On 6502 this doesn't clear the 'D' flag. Easier to explain that in text than
// create a separate definition.
//
// The processor status flags have the 'B' flag set on 6502/65C02/65816 emu mode
// when pushed onto the stack, but it doesn't affect the actual processor status
// flag in the code executed next.
//
// We don't set a StatusFlagUpdater because the flags are only changed for the
// software break handler function. If we could actually track this into that,

View File

@ -286,7 +286,12 @@ namespace Asm65 {
{ OpName.BRK,
"Pushes state onto the stack, and jumps to the software break vector at " +
"$fffe-ffff. While this is technically a single-byte instruction, the " +
"program counter pushed onto the stack is incremented by two."
"program counter pushed onto the stack is incremented by two. The interrupt " +
"flag is set, and on 65C02/65816 the D flag is cleared. " +
"On 6502, 65C02, and 65816 in emulation mode, the status flags pushed onto " +
"the stack will have the 'B' flag (which overlaps the 'X' flag) set so the " +
"interrupt handler can tell the difference between hardware and software " +
"interrupts."
},
{ OpName.BRL,
"Branches to a long relative address."