public OpcodeParamResult ParseMemoryAddressParameter (OpcodeParamResult opcodeParamResult, string clearedParameter)
{
opcodeParamResult.Param = (ushort)dcpuRegisterCodes.NextWord_Literal_Mem;
opcodeParamResult.NextWord = true;
if (clearedParameter.StartsWith("\'") && clearedParameter.EndsWith("\'") && clearedParameter.Length == 5)
{
ushort val = clearedParameter[1];
opcodeParamResult.NextWordValue = val;
}
else if (clearedParameter.Contains("0x"))
{
ushort val = Convert.ToUInt16(clearedParameter.Trim(), 16);
opcodeParamResult.NextWordValue = val;
}
else if (clearedParameter.Trim().All(x => char.IsDigit(x)))
{
ushort val = Convert.ToUInt16(clearedParameter.Trim(), 10);
opcodeParamResult.NextWordValue = val;
}
else
{
opcodeParamResult.NextWord = true;
opcodeParamResult.LabelName = clearedParameter.Trim();
}
return opcodeParamResult;
}