public int step(boolean reset, boolean firstStepOver) {
		int lastPc = this.pc;

		if (reset) {
			this.register.resetState();
			this.memory.resetState();
		}

		Instruction instruction;
		try {
			int opCode = this.memory.readInt(this.pc);
			if (opCode == 0) {
				this.ended = true;
				return 0;
			}

			instruction = InstructionManager.get(opCode);
			instruction.run(this.emulator);
			this.pc += 4;
		} catch (Exception e) {
			this.eventManager.sendEvent(EventManager.EVENT.EMULATOR_ERROR, e.getMessage());
			this.ended = true;
			return 0;
		}

		if (this.pc == lastPc) {
			this.ended = true;
			return 0;
		}

		if (this.breakpoints.containsKey(this.pc)) {
			return 0;
		}

		if (firstStepOver && (instruction instanceof jniosemu.instruction.emulator.CallInstruction || instruction instanceof jniosemu.instruction.emulator.CallrInstruction)) {
			return 2;
		}

		return 1;
	}