예제 #1
0
        private long?GetRelativeValue(OpcodeParameter param)
        {
            var idx = (int)param.Value + this.RelativeBase;

            return(GetValue(idx));
            //return long.MaxValue;
        }
예제 #2
0
        public long?GetValue(OpcodeParameter param)
        {
            if (param.Value == null)
            {
                throw new Exception("Tried to get value of 'null' OpcodeParameter!");
            }

            switch (param.Mode)
            {
            case ParameterMode.Immediate:
                return(param.Value);

            case ParameterMode.Position:
                return(GetValue((int)param.Value));

            case ParameterMode.Relative:
                return(GetRelativeValue(param));

            default:
                throw new Exception("Unknown Opcode ParameterMode encountered!");
            }
        }