The wiki says:
Point 3: why return "old status" and not "current status"?
Code:
Two 1-bit registers inside the PPU control the generation of NMI signals. Frame timing and accesses to the PPU's PPUCTRL ($2000) and PPUSTATUS ($2002) registers change these registers as follows, regardless of whether rendering is enabled:
1.Start of vertical blanking: Set NMI_occurred in PPU to true.
2.End of vertical blanking, sometime in pre-render scanline: Set NMI_occurred to false.
3.Read $2002: Return old status of NMI_occurred in bit 7, then set NMI_occurred to false.
4.Write to $2000: Set NMI_output to bit 7.
The PPU pulls /NMI low if and only if both NMI_occurred and NMI_output are true. By toggling NMI_output ($2000 bit 7) during vertical blank without reading $2002, a program can cause /NMI to be pulled low multiple times, causing multiple NMIs to be generated.
1.Start of vertical blanking: Set NMI_occurred in PPU to true.
2.End of vertical blanking, sometime in pre-render scanline: Set NMI_occurred to false.
3.Read $2002: Return old status of NMI_occurred in bit 7, then set NMI_occurred to false.
4.Write to $2000: Set NMI_output to bit 7.
The PPU pulls /NMI low if and only if both NMI_occurred and NMI_output are true. By toggling NMI_output ($2000 bit 7) during vertical blank without reading $2002, a program can cause /NMI to be pulled low multiple times, causing multiple NMIs to be generated.
Point 3: why return "old status" and not "current status"?