public int[] compile(String[] commandsArray) throws Exception {
		int commandNr = 0;
		int commandsIntArray[] = new int[MAX_CS_SIZE];
		for (int i = 0; i < commandsArray.length; i++) {
			if (commandsArray[i].trim().equals("")) {
				continue;
			} else {
				CmdWithVar cmd = recognizeStringCommand(commandsArray[i], i);
				if (cmd == null) {
					throw new Exception("Komanda neatpažinta. Komanda: "
							+ commandsArray[i] + ". Eilute: " + i);
				} else {
					cmdWithVar[commandNr] = cmd;

					String first = this.fixBinaryNumber(cmd.commandOpc, 8);

					if ((cmd.command.equals(Command.MOV_AX))
							|| (cmd.command.equals(Command.MOV_BX))) {
						String second = this.fixBinaryNumber(cmd.variable, 32);
						commandsIntArray[commandNr] = Integer
								.parseInt(first, 2);
						commandsIntArray[commandNr + 1] = Integer.parseInt(
								addMinus(second, 32), 2);
						commandNr++;
					} else {
						String second = this.fixBinaryNumber(cmd.variable, 8);
						commandsIntArray[commandNr] = Integer.parseInt(first
								+ second, 2);
					}
					commandNr++;
				}
			}
		}

		this.setProgramSize(commandNr);
		int firstZero = MAX_CS_SIZE;
		for (int i = 0; i < commandsIntArray.length; i++) {
			if (commandsIntArray[i] == 0) {
				firstZero = i;
				break;
			}
		}
		return Arrays.copyOf(commandsIntArray, firstZero);
	}