public string AnalyzeLine(int iARR, int iIAR, int iXR1, int iXR2, string strInstMnem, int iDAR, int iCAR, int iSNS, CDiskControlField dcf) { ParseTraceLine(); StringBuilder strbldCompareResults = new StringBuilder(); char[] caSpace = { ' ' }; if (m_iARR != iARR) { if (!m_bARRErrorFound || m_iLastBadARR != iARR) { strbldCompareResults.Append(string.Format("ARR @ #{0:D} ({1:X4})", m_iLastCPULine, iARR)); m_iLastBadARR = iARR; m_bARRErrorFound = true; } } else { m_bARRErrorFound = false; } if (m_iIAR != iIAR) { m_bAbort = true; if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strbldCompareResults.Append(string.Format("IAR @ #{0:D} ({1:X4})", m_iLastCPULine, iIAR)); } if (m_iXR1 != iXR1) { if (!m_bXR1ErrorFound || m_iLastBadXR1 != iXR1) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strbldCompareResults.Append(string.Format("XR1 @ #{0:D} ({1:X4})", m_iLastCPULine, iXR1)); m_bXR1ErrorFound = true; m_iLastBadXR1 = iXR1; } } else { m_bXR1ErrorFound = false; } if (m_iXR2 != iXR2) { if (!m_bXR2ErrorFound || m_iLastBadXR2 != iXR2) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strbldCompareResults.Append(string.Format("XR2 @ #{0:D} ({1:X4})", m_iLastCPULine, iXR2)); m_bXR2ErrorFound = true; m_iLastBadXR2 = iXR2; } } else { m_bXR2ErrorFound = false; } if (m_bDiskValid) { if (m_iDAR != iDAR) { if (!m_bDARErrorFound || m_iLastBadDAR != iDAR) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strbldCompareResults.Append(string.Format("DAR @ #{0:D} ({1:X4})", m_iLastCPULine, iDAR)); m_bDARErrorFound = true; m_iLastBadDAR = iDAR; } } else { m_bDARErrorFound = false; } if (m_iCAR != iCAR) { if (!m_bCARErrorFound || m_iLastBadCAR != iCAR) { m_bCARErrorFound = true; m_iLastBadCAR = iCAR; if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strbldCompareResults.Append(string.Format("CAR @ #{0:D} ({1:X4})", m_iLastCPULine, iCAR)); } } else { m_bCARErrorFound = false; } if (!m_bFisDots && m_iF != dcf.yF) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strbldCompareResults.Append(string.Format("F @ #{0:D} ({1:X2} s/b {2:X2})", m_iLastCPULine, dcf.yF, m_iF)); } if (m_bDiskValid && m_iC != dcf.yC) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strbldCompareResults.Append(string.Format("C @ #{0:D} ({1:X2} s/b {2:X2})", m_iLastCPULine, dcf.yC, m_iC)); } if (m_bDiskValid && m_iS != dcf.yS) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strbldCompareResults.Append(string.Format("S @ #{0:D} ({1:X2} s/b {2:X2})", m_iLastCPULine, dcf.yS, m_iS)); } if (m_bDiskValid && m_iN != dcf.yN) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strbldCompareResults.Append(string.Format("N @ #{0:D} ({1:X2} s/b {2:X2})", m_iLastCPULine, dcf.yN, m_iN)); } } if (m_bSNSValid && m_iDiskSNS != iSNS) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strbldCompareResults.Append(string.Format("SNS @ #{0:D} ({1:X4} != {2:X4})", m_iLastCPULine, iSNS, m_iDiskSNS)); } if (m_strInstMnem.TrimEnd(caSpace) != strInstMnem.TrimEnd(caSpace)) { m_bAbort = true; if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strbldCompareResults.Append(string.Format("Mnem @ #{0:D} ({1:S})", m_iLastCPULine, m_strInstMnem)); } if (strbldCompareResults.Length > 0) { return(string.Format(" * * * {0:S}", strbldCompareResults.ToString())); } else { return(""); } }
public List <string> AnalyzeLine(int[] iaARR, int iIAR, int iXR1, int iXR2, string strInstMnem, int iDAR, int iCAR, int iSNS, CDiskControlField dcf, ref int iIL, ref int iTraceIdx) { List <string> strlErrors = new List <string> (); if (!ParseTraceLine(ref iIL)) { m_bAbort = true; return(strlErrors); } char[] caSpace = { ' ' }; string strLine = m_iTraceIdx.ToString(), strPadding = new string (' ', 8 - strLine.Length); string strAsterisks = " * * * <" + strPadding + strLine + "> "; int iAsteriskLength = strAsterisks.Length; string strSpaces = new string (' ', iAsteriskLength); StringBuilder strbldCompareResults = new StringBuilder(); if (m_iIAR != iIAR) { //m_bAbort = true; if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strlErrors.Add(strAsterisks + string.Format("IAR @ #{0:D} ({1:X4} s/b {2:X4})", m_iLastCPULine, iIAR, m_iIAR)); strAsterisks = strSpaces; } if (m_strInstMnem.TrimEnd(caSpace) != strInstMnem.TrimEnd(caSpace)) { //m_bAbort = true; if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strlErrors.Add(strAsterisks + string.Format("Mnem @ #{0:D} ({1:X4} s/b {2:X4})", m_iLastCPULine, strInstMnem.TrimEnd(), m_strInstMnem.TrimEnd())); strAsterisks = new string (' ', iAsteriskLength); } if (m_iARR != iaARR[iIL]) { if (!m_bARRErrorFound || m_iLastBadARR != iaARR[iIL]) { strlErrors.Add(strAsterisks + string.Format("ARR @ #{0:D} ({1:X4} s/b {2:X4})", m_iLastCPULine, iaARR[iIL], m_iARR)); strAsterisks = strSpaces; m_iLastBadARR = iaARR[iIL]; m_bARRErrorFound = true; } } else { m_bARRErrorFound = false; } if (m_iXR1 != iXR1) { if (!m_bXR1ErrorFound || m_iLastBadXR1 != iXR1) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strlErrors.Add(strAsterisks + string.Format("XR1 @ #{0:D} ({1:X4} s/b {2:X4})", m_iLastCPULine, iXR1, m_iXR1)); strAsterisks = strSpaces; m_bXR1ErrorFound = true; m_iLastBadXR1 = iXR1; } } else { m_bXR1ErrorFound = false; } if (m_iXR2 != iXR2) { if (!m_bXR2ErrorFound || m_iLastBadXR2 != iXR2) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strlErrors.Add(strAsterisks + string.Format("XR2 @ #{0:D} ({1:X4} s/b {2:X4})", m_iLastCPULine, iXR2, m_iXR2)); strAsterisks = strSpaces; m_bXR2ErrorFound = true; m_iLastBadXR2 = iXR2; } } else { m_bXR2ErrorFound = false; } if (m_bDiskValid) { if (m_iDAR != iDAR) { if (!m_bDARErrorFound || m_iLastBadDAR != iDAR) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strlErrors.Add(strAsterisks + string.Format("DAR @ #{0:D} ({1:X4} s/b {2:X4})", m_iLastCPULine, iDAR, m_iDAR)); strAsterisks = strSpaces; m_bDARErrorFound = true; m_iLastBadDAR = iDAR; } } else { m_bDARErrorFound = false; } if (m_iCAR != iCAR) { if (!m_bCARErrorFound || m_iLastBadCAR != iCAR) { m_bCARErrorFound = true; m_iLastBadCAR = iCAR; if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strlErrors.Add(strAsterisks + string.Format("CAR @ #{0:D} ({1:X4} s/b {2:X4})", m_iLastCPULine, iCAR, m_iCAR)); strAsterisks = strSpaces; } } else { m_bCARErrorFound = false; } if (!m_bFisDots && m_iF != dcf.yF) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strlErrors.Add(strAsterisks + string.Format("F @ #{0:D} ({1:X4} s/b {2:X4})", m_iLastCPULine, dcf.yF, m_iF)); strAsterisks = strSpaces; } if (m_bDiskValid && m_iC != dcf.yC) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strlErrors.Add(strAsterisks + string.Format("C @ #{0:D} ({1:X4} s/b {2:X4})", m_iLastCPULine, dcf.yC, m_iC)); strAsterisks = strSpaces; } if (m_bDiskValid && m_iS != dcf.yS) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strlErrors.Add(strAsterisks + string.Format("S @ #{0:D} ({1:X4} s/b {2:X4})", m_iLastCPULine, dcf.yS, m_iS)); strAsterisks = strSpaces; } if (m_bDiskValid && m_iN != dcf.yN) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strlErrors.Add(strAsterisks + string.Format("N @ #{0:D} ({1:X4} s/b {2:X4})", m_iLastCPULine, dcf.yN, m_iN)); strAsterisks = strSpaces; } } if (m_bSNSValid && m_iDiskSNS != iSNS) { if (strbldCompareResults.Length > 0) { strbldCompareResults.Append(", "); } strlErrors.Add(strAsterisks + string.Format("SNS @ #{0:D} ({1:X4} s/b {2:X4})", m_iLastCPULine, iSNS, m_iDiskSNS)); strAsterisks = strSpaces; } iTraceIdx = m_iTraceIdx; return(strlErrors); }