public void decode_instruction(String raw_instruction, Hashtable<String, Integer> label_map) {
		StringTokenizer st = new StringTokenizer(raw_instruction, ",");
		StringTokenizer st1 = new StringTokenizer(st.nextToken());
		String ins_type = st1.nextToken().trim(), target = st1.nextToken()
				.trim();
		get_class(ins_type);

		switch(format){
		case 0:
			rd = RegisterMapper.map_to_index(target.trim());
			if(type!= InstructionType.lui){
				rs = RegisterMapper.map_to_index(st.nextToken().trim());
			}
			if (immediate){
				immediate_value = Integer.parseInt(st.nextToken().trim());
			}
			else{
				rt = RegisterMapper.map_to_index(st.nextToken().trim());
			}
			break;
		case 1:
			rt = RegisterMapper.map_to_index(target.trim());
			if (immediate){
				immediate_value = Integer.parseInt(st.nextToken().trim());
			}
			else{
				StringTokenizer st2 = new StringTokenizer(st.nextToken().trim(),"(");
				immediate_value = Integer.parseInt(st2.nextToken().trim());
				String str = st2.nextToken().trim();
				rs = RegisterMapper.map_to_index(str.substring(0,str.length()-1));
			}
			break;
		case 2:
			rt = RegisterMapper.map_to_index(target.trim());
			StringTokenizer st2 = new StringTokenizer(st.nextToken().trim(),"(");
			immediate_value = Integer.parseInt(st2.nextToken().trim());
			String str = st2.nextToken().trim();
			rs = RegisterMapper.map_to_index(str.substring(0,str.length()-1));
			break;
		case 3:
			rs = RegisterMapper.map_to_index(target.trim());
			rt = RegisterMapper.map_to_index(st.nextToken().trim());
			immediate_value = label_map.get(st.nextToken().trim()); 
			break;
		case 4:
			immediate_value = label_map.get(target.trim());
			break;
		case 5:
			rs = Integer.parseInt(target.trim());
			break;
		}
	}