package ga050426;

public class BitsManipulator {

	public static short makeIRWord(byte opcode, short address) {
		short word;
		word = (short)opcode;
		word <<= 10;
		address &= 0x03ff;
		word = (short) (word | address);
		return word;
	}
	public static short makeIRWord(byte opcode){
		short word;
		word=opcode;
		word<<=10;
		return word;
	}
	public static byte getHigherByte(int word) {
		return (byte) (Integer.rotateRight(word, 8));
	}

	public static byte getLowerByte(short word) {
		return (byte) word;
	}

}
