Beispiel #1
0
        public COMDEFRecord(RecordReader reader, RecordContext context)
            : base(reader, context)
        {
            int startIndex = context.ExternalNames.Count;

            while (!reader.IsEOF)
            {
                CommunalNameDefinition def = new CommunalNameDefinition();
                def.DefinedBy    = reader.RecordNumber;
                def.Name         = reader.ReadPrefixedString();
                def.TypeIndex    = reader.ReadIndex();
                def.DataType     = reader.ReadByte();
                def.ElementCount = ReadEncodedInteger(reader);
                if (def.DataType == 0x61) // FAR data: count, elemsize
                {
                    def.ElementSize = ReadEncodedInteger(reader);
                }
                else
                {
                    def.ElementSize = 1;
                }
                context.ExternalNames.Add(def);
            }
            int endIndex = context.ExternalNames.Count;

            this.Definitions = context.ExternalNames.Slice(
                startIndex, endIndex - startIndex);
        }
Beispiel #2
0
        public ALIASRecord(RecordReader reader, RecordContext context)
            : base(reader, context)
        {
            int startIndex = context.Aliases.Count;

            while (!reader.IsEOF)
            {
                AliasDefinition def = new AliasDefinition();
                def.AliasName      = reader.ReadPrefixedString();
                def.SubstituteName = reader.ReadPrefixedString();
                context.Aliases.Add(def);
            }
            int endIndex = context.Aliases.Count;

            this.Definitions = context.Aliases.Slice(startIndex, endIndex - startIndex);
        }
Beispiel #3
0
        internal ListOfNamesRecord(RecordReader reader, RecordContext context)
            : base(reader, context)
        {
            List <string> names = new List <string>();

            while (!reader.IsEOF)
            {
                names.Add(reader.ReadPrefixedString());
            }
            this.Names = names.ToArray();
            context.Names.AddRange(Names);
        }
Beispiel #4
0
        public PUBDEFRecord(RecordReader reader, RecordContext context)
            : base(reader, context)
        {
            int baseGroupIndex = reader.ReadIndex();

            if (baseGroupIndex > context.Groups.Count)
            {
                throw new InvalidDataException("GroupIndex is out of range.");
            }
            if (baseGroupIndex > 0)
            {
                this.BaseGroup = context.Groups[baseGroupIndex - 1];
            }

            int baseSegmentIndex = reader.ReadIndex();

            if (baseSegmentIndex > context.Segments.Count)
            {
                throw new InvalidDataException("SegmentIndex is out of range.");
            }
            if (baseSegmentIndex == 0)
            {
                this.BaseFrame = reader.ReadUInt16();
            }
            else
            {
                this.BaseSegment = context.Segments[baseSegmentIndex - 1];
            }

            int startIndex = context.PublicNames.Count;

            while (!reader.IsEOF)
            {
                PublicNameDefinition def = new PublicNameDefinition();
                def.DefinedBy   = reader.RecordNumber;
                def.BaseGroup   = BaseGroup;
                def.BaseSegment = BaseSegment;
                def.BaseFrame   = BaseFrame;
                def.Name        = reader.ReadPrefixedString();
                def.Offset      = (int)reader.ReadUInt16Or32();
                def.TypeIndex   = reader.ReadIndex();
                context.PublicNames.Add(def);
            }
            int endIndex = context.PublicNames.Count;

            this.Definitions = context.PublicNames.Slice(
                startIndex, endIndex - startIndex);
        }
Beispiel #5
0
        public EXTDEFRecord(RecordReader reader, RecordContext context)
            : base(reader, context)
        {
            int startIndex = context.ExternalNames.Count;

            while (!reader.IsEOF)
            {
                ExternalNameDefinition def = new ExternalNameDefinition();
                def.Name      = reader.ReadPrefixedString();
                def.TypeIndex = reader.ReadIndex();
                def.DefinedBy = reader.RecordNumber;
                context.ExternalNames.Add(def);
            }
            int endIndex = context.ExternalNames.Count;

            this.Definitions = context.ExternalNames.Slice(
                startIndex, endIndex - startIndex);
        }
Beispiel #6
0
 public LIBMODComment(RecordReader reader, RecordContext context)
 {
     this.ModuleName = reader.ReadPrefixedString();
     context.ObjectName = ModuleName;
 }
Beispiel #7
0
 public THEADRRecord(RecordReader reader, RecordContext context)
     : base(reader, context)
 {
     this.Name = reader.ReadPrefixedString();
     context.SourceName = Name;
 }
Beispiel #8
0
        public PUBDEFRecord(RecordReader reader, RecordContext context)
            : base(reader, context)
        {
            int baseGroupIndex = reader.ReadIndex();
            if (baseGroupIndex > context.Groups.Count)
                throw new InvalidDataException("GroupIndex is out of range.");
            if (baseGroupIndex > 0)
                this.BaseGroup = context.Groups[baseGroupIndex - 1];

            int baseSegmentIndex = reader.ReadIndex();
            if (baseSegmentIndex > context.Segments.Count)
                throw new InvalidDataException("SegmentIndex is out of range.");
            if (baseSegmentIndex == 0)
                this.BaseFrame = reader.ReadUInt16();
            else
                this.BaseSegment = context.Segments[baseSegmentIndex - 1];

            int startIndex = context.PublicNames.Count;
            while (!reader.IsEOF)
            {
                PublicNameDefinition def = new PublicNameDefinition();
                def.DefinedBy = reader.RecordNumber;
                def.BaseGroup = BaseGroup;
                def.BaseSegment = BaseSegment;
                def.BaseFrame = BaseFrame;
                def.Name = reader.ReadPrefixedString();
                def.Offset = (int)reader.ReadUInt16Or32();
                def.TypeIndex = reader.ReadIndex();
                context.PublicNames.Add(def);
            }
            int endIndex = context.PublicNames.Count;
            this.Definitions = context.PublicNames.Slice(
                startIndex, endIndex - startIndex);
        }
Beispiel #9
0
 public LHEADRRecord(RecordReader reader, RecordContext context)
     : base(reader, context)
 {
     this.Name = reader.ReadPrefixedString();
 }
Beispiel #10
0
 public EXTDEFRecord(RecordReader reader, RecordContext context)
     : base(reader, context)
 {
     int startIndex = context.ExternalNames.Count;
     while (!reader.IsEOF)
     {
         ExternalNameDefinition def = new ExternalNameDefinition();
         def.Name = reader.ReadPrefixedString();
         def.TypeIndex = reader.ReadIndex();
         def.DefinedBy = reader.RecordNumber;
         context.ExternalNames.Add(def);
     }
     int endIndex = context.ExternalNames.Count;
     this.Definitions = context.ExternalNames.Slice(
         startIndex, endIndex - startIndex);
 }
Beispiel #11
0
 public COMDEFRecord(RecordReader reader, RecordContext context)
     : base(reader, context)
 {
     int startIndex = context.ExternalNames.Count;
     while (!reader.IsEOF)
     {
         CommunalNameDefinition def = new CommunalNameDefinition();
         def.DefinedBy = reader.RecordNumber;
         def.Name = reader.ReadPrefixedString();
         def.TypeIndex = reader.ReadIndex();
         def.DataType = reader.ReadByte();
         def.ElementCount = ReadEncodedInteger(reader);
         if (def.DataType == 0x61) // FAR data: count, elemsize
             def.ElementSize = ReadEncodedInteger(reader);
         else
             def.ElementSize = 1;
         context.ExternalNames.Add(def);
     }
     int endIndex = context.ExternalNames.Count;
     this.Definitions = context.ExternalNames.Slice(
         startIndex, endIndex - startIndex);
 }
Beispiel #12
0
 public ALIASRecord(RecordReader reader, RecordContext context)
     : base(reader, context)
 {
     int startIndex = context.Aliases.Count;
     while (!reader.IsEOF)
     {
         AliasDefinition def = new AliasDefinition();
         def.AliasName = reader.ReadPrefixedString();
         def.SubstituteName = reader.ReadPrefixedString();
         context.Aliases.Add(def);
     }
     int endIndex = context.Aliases.Count;
     this.Definitions = context.Aliases.Slice(startIndex, endIndex - startIndex);
 }
Beispiel #13
0
 internal ListOfNamesRecord(RecordReader reader, RecordContext context)
     : base(reader, context)
 {
     List<string> names = new List<string>();
     while (!reader.IsEOF)
     {
         names.Add(reader.ReadPrefixedString());
     }
     this.Names = names.ToArray();
     context.Names.AddRange(Names);
 }
Beispiel #14
0
 public LIBMODComment(RecordReader reader, RecordContext context)
 {
     this.ModuleName    = reader.ReadPrefixedString();
     context.ObjectName = ModuleName;
 }
Beispiel #15
0
 public LHEADRRecord(RecordReader reader, RecordContext context)
     : base(reader, context)
 {
     this.Name = reader.ReadPrefixedString();
 }
Beispiel #16
0
 public THEADRRecord(RecordReader reader, RecordContext context)
     : base(reader, context)
 {
     this.Name          = reader.ReadPrefixedString();
     context.SourceName = Name;
 }