FSO.HIT.HITInterpreter.Jump C# (CSharp) Метод

Jump() публичный статический Метод

Jump to a given address.
public static Jump ( HITThread thread ) : HITResult
thread HITThread
Результат HITResult
        public static HITResult Jump(HITThread thread)
        {
            var read = thread.ReadByte();

            if (read > 15) //literal
            {
                thread.PC--; //backtraaackkk
                thread.PC = thread.ReadUInt32();
            }
            else //no idea if there are collisions. if there are i'm blaming fatbag. >:)
            {
                thread.PC = (uint)thread.ReadVar(read);
                if (thread.ReadByte() == 0) thread.PC += 2; //if next is no-op, the operand is 4 byte
                else thread.PC--; //operand is 1 byte (next is an instruction), backtrack
            }

            return HITResult.CONTINUE;
        }