Cosmos/source/Indy.IL2CPU.Assembler.X86/X/Memory.cs
kudzu_cp 517186b7df
2008-04-28 01:55:29 +00:00

45 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Indy.IL2CPU.Assembler.X86.X {
public class Memory {
public Action this[Address aAddress] {
get {
return new MemoryAction(aAddress.ToString());
}
//set {
// Future - need to handle registers, but should reject
// any memory, memory should force size usage below
//}
}
public Action this[Address aAddress, byte aSize] {
get {
return new MemoryAction(aAddress.ToString());
}
set {
string xSizeString;
switch (aSize) {
case 8:
xSizeString = "byte";
break;
case 16:
xSizeString = "word";
break;
case 32:
xSizeString = "dword";
break;
case 64:
xSizeString = "qword";
break;
default:
throw new Exception("Invalid size: " + aSize.ToString());
break;
}
new X86.Move(xSizeString, aAddress.ToString(), value.ToString());
}
}
}
}