Please consider the code in Super NES Programming/Initialization Tutorial/Snes Init.
Here is an excerpt:
stz $2113 ; Plane 3 scroll x (first 8 bits)
stz $2113 ; Plane 3 scroll x (last 3 bits) #$0 - #$07ff
From the comments, this seems intuitive enough. However, when I look at the instruction set reference provided in 6.5 LDA LDX LDY STA STX STY STZ:
STZ store zero into the memory location specified by the operand."
and
Note that no registers are affected by STZ.
From this it seems that STZ with some constant operand should yield the exact same result every time it is executed, so what is the point in executing it with the same operand immediately after the previous instruction?
What is the variable here? Time? 0x2113 is a hardware register, and according to Super NES Programming/SNES Hardware Registers, it is the "BG 4 Horizontal Scroll Offset". This doesn't seem to match the comment in the source for it being "Plane 3 scroll x".
Anyway, does 0x2113 perhaps map to different actual memory/hardware registers depending on time? E.g. at some horizontal scanline the 0x2113 points to a particular horizontal scroll offset?
But even if that were true, I don't see why issuing the instruction only twice like that (and apparently with no code to check timing) would do any good.
Clearly I'm missing something obvious, or there is something weird with the source. I'm pretty certain it is me though, since the source assembles and runs perfectly fine.