protected int roxl_byte_reg(int opcode)
	{
		int shift = cpu.getDataRegisterLong((opcode >> 9) & 0x07) & 63;

		int reg = (opcode & 0x07);
		int d = cpu.getDataRegisterByte(reg);

		int last_out;
		boolean xflag=cpu.isFlagSet(Cpu.X_FLAG);        // state of the X flag
		int maskFlags=xflag?Cpu.X_FLAG:0;               // value of X flag at start of operation
		for(int s= 0; s < shift; s++)
		{
			last_out = d & 0x80;                    // state of last bit befrre rotate
			d <<= 1;                               
			if (xflag)                              // X flag was set before the rotate
				d |= 1;                             // so set it in LSB
			if(last_out != 0)                       // now set new state of X flag according to last bit moved out
				xflag=true;
			else
				xflag=false;
		}
		d &= 0xff;
		cpu.setDataRegisterByte(reg, d);
		if (shift!=0)                                   // X flags in unaffected by a 0 count rotate
		{
			if (xflag)
				maskFlags=Cpu.X_FLAG+Cpu.C_FLAG;        // if last bit was 1, set flags accordingly
			else
				maskFlags=0;                            // these flags aren't set
		}
		else
		{
			if (maskFlags!=0)
				maskFlags +=Cpu.C_FLAG;                 //  rotate count : c flag = state of x flag
		}
		if (d==0)
			maskFlags+=Cpu.Z_FLAG;
		if((d & 0x80)!=0)
			maskFlags+=Cpu.N_FLAG;                      // N flag (the V flag is always 0)
		cpu.setCCRegister(maskFlags);
		return 6 + shift + shift;
	}