The flag bits are mostly NOT initialised on reset. The exceptions are that interrupts start out masked (because Reset is treated as a special kind of interrupt, and all interrupts mask further interrupts), and on CMOS versions the D flag is also cleared - but on NMOS the D flag is NOT initialised. NZCV flags could be in any random state, but this mostly doesn't matter because they will quickly be set by ALU instructions during the boot sequence. By the same token, the stack pointer is not initialised by reset. Thus, most reset handling code running on the 6502 starts by clearing the D flag and loading $FF into the stack pointer.
So far as a simulator is concerned, you could load a fixed value into both the stack and status registers, and software that runs on a real 6502 will then work in your simulator. The only real difficulty you might then encounter is that software you write and test on your simulator might not behave precisely the same way when you subsequently try it on real hardware. To deal with the latter, you could actively randomise the values and bits that are not specifically initialised.
|