I'm reading code for creating a digital oscillator. This part is storing sample values in a buffer.
On the line
short ss is shifted to the right, and then ss is used again on the next line.
The purpose of the code is to store two bytes of a short sequentially in the buffer,
but for the code to make sense wouldn't ss have to have it's original value on both lines, which means
the value of ss was not changed by >> 8? Otherwise, the first line gets rid of the least significant byte.
No, shifting operations don't change the value of the variable they are applied to. Neither do arithmetic operations: a * 10 produces the value of a multiplied by 10 as its value, but it doesn't change the value of a at all. In fact the only operations which change the value of the variable they are applied to are the two increment operations (represented by ++) and the two decrement operations (represented by --).
And if you play around with code you'll notice that most operations can be applied to things other than variables; consider 6 + 7 for example. It produces 13 as its value, but clearly it doesn't change the value of 6. Or consider (a + b) * 10... this is a perfectly ordinary arithmetic expression and it doesn't change the value of any variable either. The only exceptions to this rule are the increment and decrement operations which I mentioned earlier; they can only be applied to variables, because they do change the value of the thing they are applied to.
It's actually more complicated than that, because there's the "=" operation which assigns the value on its right to the variable on its left, and everything I've said here about "variables" can apply to array entries, for example numbers[i] << 3, but hopefully I've addressed your concern.