remove obsolet abstract GetData()

This commit is contained in:
Trivalik_cp 2014-11-19 13:34:10 +00:00
parent 41584c0fe8
commit ff4fc84cf9
7 changed files with 1 additions and 78 deletions

View file

@ -58,7 +58,7 @@ namespace Cosmos.Assembler
}
public abstract bool IsComplete( Assembler aAssembler );
public abstract byte[] GetData( Assembler aAssembler );
public abstract void WriteData( Assembler aAssembler, Stream aOutput );
public abstract void WriteText( Assembler aAssembler, TextWriter aOutput );

View file

@ -37,10 +37,5 @@ namespace Cosmos.Assembler
{
return true;
}
public override byte[] GetData( Assembler aAssembler )
{
return new byte[ 0 ];
}
}
}

View file

@ -223,40 +223,6 @@ namespace Cosmos.Assembler {
return true;
}
public override byte[] GetData(Assembler aAssembler) {
if (UntypedDefaultValue != null &&
UntypedDefaultValue.LongLength > 0) {
var xBuff = (byte[])Array.CreateInstance(typeof(byte), UntypedDefaultValue.LongLength * 4);
for (int i = 0; i < UntypedDefaultValue.Length; i++) {
var xRef = UntypedDefaultValue[i] as Cosmos.Assembler.ElementReference;
byte[] xTemp;
if (xRef != null) {
var xTheRef = aAssembler.TryResolveReference(xRef);
if (xTheRef == null) {
throw new Exception("Reference not found!");
}
if (!xTheRef.ActualAddress.HasValue) {
Console.Write("");
}
xTemp = BitConverter.GetBytes(xTheRef.ActualAddress.Value);
} else {
if (UntypedDefaultValue[i] is int) {
xTemp = BitConverter.GetBytes((int)UntypedDefaultValue[i]);
} else {
if (UntypedDefaultValue[i] is uint) {
xTemp = BitConverter.GetBytes((uint)UntypedDefaultValue[i]);
} else {
throw new Exception("Invalid value inside UntypedDefaultValue");
}
}
}
Array.Copy(xTemp, 0, xBuff, i * 4, 4);
}
return xBuff;
}
return RawDefaultValue;
}
public override void WriteData(Cosmos.Assembler.Assembler aAssembler, Stream aOutput) {
if (UntypedDefaultValue != null &&
UntypedDefaultValue.LongLength > 0) {

View file

@ -60,10 +60,5 @@ namespace Cosmos.Assembler {
public override void WriteData(Cosmos.Assembler.Assembler aAssembler, Stream aOutput) {
throw new NotImplementedException("Method not implemented for instruction " + this.GetType().FullName.Substring(typeof(Instruction).Namespace.Length + 1));
}
[Obsolete]
public override byte[] GetData(Assembler aAssembler) {
throw new NotImplementedException("Method not implemented for instruction " + this.GetType().FullName.Substring(typeof(Instruction).Namespace.Length + 1));
}
}
}

View file

@ -65,19 +65,6 @@ namespace Cosmos.Assembler.x86 {
base.UpdateAddress(aAssembler, ref aAddresss);
}
public override byte[] GetData( Cosmos.Assembler.Assembler aAssembler )
{
if (DestinationRef != null) {
ulong xAddress = 0;
if (!DestinationRef.Resolve(aAssembler, out xAddress)) {
throw new Exception("Cannot resolve DestinationRef!");
}
DestinationValue = (uint)xAddress;
}
return base.GetData(aAssembler);
}
public override void WriteText( Cosmos.Assembler.Assembler aAssembler, System.IO.TextWriter aOutput )
{
aOutput.Write(mMnemonic);

View file

@ -91,16 +91,6 @@ namespace Cosmos.Assembler.x86 {
base.UpdateAddress(aAssembler, ref aAddress);
}
public override byte[] GetData(Cosmos.Assembler.Assembler aAssembler) {
if (SourceRef != null) {
ulong xAddress = 0;
if (!SourceRef.Resolve(aAssembler, out xAddress)) {
throw new Exception("Cannot resolve SourceRef!");
}
SourceValue = (uint)xAddress;
}
return base.GetData(aAssembler);
}
public override void WriteText( Cosmos.Assembler.Assembler aAssembler, System.IO.TextWriter aOutput )
{
aOutput.Write(mMnemonic);

View file

@ -85,16 +85,6 @@ namespace Cosmos.Assembler.x86 {
base.UpdateAddress(aAssembler, ref aAddress);
}
public override byte[] GetData(Cosmos.Assembler.Assembler aAssembler) {
if (ArgumentRef != null) {
ulong xAddress = 0;
if (!ArgumentRef.Resolve(aAssembler, out xAddress)) {
throw new Exception("Cannot resolve ArgumentRef!");
}
ArgumentValue = (uint)xAddress;
}
return base.GetData(aAssembler);
}
public override void WriteText( Cosmos.Assembler.Assembler aAssembler, System.IO.TextWriter aOutput )
{
aOutput.Write(mMnemonic);