how to rotate a byte

How do I do a rotate through carry as opposed to an arithmetic shift.

I'm trying to write a white noise generator for the "engine" noise in a lunar lander game.

The >> and << operators "loose" the carry bit,

Basicaly it's an 16 bit shit register with an EOR of bits 7 & 15 back into bit 0.

Do the Atmel chips have a ROR & ROL instruction as well as the ASL & LSR instructions?

So once again, is this something I need inline assembler to do?

Yes the chips do have this but as an 8 bit instruction. You can use assembler or you can do it by hand by using shift. Copy the most significant bit before the shift, do the shift and then if the most significant bit was one set the least significant bit.

Can I put inline assembler or (because I like to suffer) op-codes in a sketch?

I've not seen any reference to inline assembler or code anywhere.

For left shifts, you can test the high bit and then or it with the shifted data. Similiarly with right shifts.

Something like this:

Mydata = ((mydata & 0x80)?0x01:0x00) | (mydata << 1);

Use 0x8000 for 16-bit types.

Just be careful that the above code is dependent on the sequence of evaluation and you may need to break it down into two statements to avoid that problem.

The right shift version is

Mydata = ((mydata & 0x01)?0x80:0x00) | (mydata >> 1)j

Again, use 0x8000 for 16-bit types.

One word of caution: the above applies to just unsigned types. Right shifting signed types takes special precaution.

That the rotate instructions are only 8 bits is exactly what I'm looking for.

What I'm trying to do is a 16 bit psuedo random number generator.
Two 8 bit shift registers, conected together, with an EOR gate.
The 2 inputs of the EOR gate are conected to the outputs of the shift registers, the output of the EOR gate is conected to the input of the first shift register.

I'd draw a circuit, but it doesn't look like I can post anything from a mobile!

Anyway, if you use the bit 15 output to drive a speaker and change the clock rate, you can make a passible engine noise generator.

If you want to get trickier, use an AND gate, take your white noise generator output and a tone to get other effects.