Ejemplo n.º 1
0
        //------------------------------------------------------------
        // XDataに書き込む。
        public void XDataWrite(XDataWriter aWriter, uint aIndex)
        {
            aWriter.WriteIndent();
            aWriter.WriteComment("[" + aIndex.ToString("X4") + "]" + ToASMText());
            aWriter.WriteUInt8((byte)mOp);
            switch (mFormat)
            {
            case OpFormat.CS2:
            {
                aWriter.WriteUInt8(0xFF);         // dummy
                aWriter.WriteSInt16(mCS2);
            }
            break;

            case OpFormat.CU1:
            {
                aWriter.WriteUInt8(mCU1A);
                aWriter.WriteUInt16(0xFFFF);         // dummy
            }
            break;

            case OpFormat.CU1_CU1:
            {
                aWriter.WriteUInt8(mCU1A);
                aWriter.WriteUInt8(mCU1B);
                aWriter.WriteUInt8(0xFF);         // dummy
            }
            break;

            case OpFormat.FR1_SR1:
            {
                aWriter.WriteUInt8(mFR1);
                aWriter.WriteUInt8(mSR1.Index());
                aWriter.WriteUInt8(0xFF);         // dummy
            }
            break;

            case OpFormat.SR1:
            {
                aWriter.WriteUInt8(mSR1.Index());
                aWriter.WriteUInt16(0xFFFF);         // dummy
            }
            break;

            case OpFormat.SR1_CS2:
            {
                aWriter.WriteUInt8(mSR1.Index());
                aWriter.WriteSInt16(mCS2);
            }
            break;

            case OpFormat.SR1_CTI:
            {
                aWriter.WriteUInt8(mSR1.Index());
                aWriter.WriteUInt16((ushort)mConstantValue.Offset());
            }
            break;

            case OpFormat.SR1_SR2:
            {
                aWriter.WriteUInt8(mSR1.Index());
                aWriter.WriteUInt8(mSR2.Index());
                aWriter.WriteUInt8(0xFF);         // dummy
            }
            break;

            case OpFormat.SR1_SR2_SR3:
            {
                aWriter.WriteUInt8(mSR1.Index());
                aWriter.WriteUInt8(mSR2.Index());
                aWriter.WriteUInt8(mSR3.Index());
            }
            break;

            case OpFormat.STI:
            {
                aWriter.WriteUInt8(0xFF);         // dummy
                aWriter.WriteUInt16(mSymbolLink.Index);
            }
            break;

            default:
                Assert.NotReachHere();
                break;
            }
            aWriter.WriteLine();
        }