mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
36 lines
859 B
C#
36 lines
859 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Cosmos.Compiler.Assembler;
|
|
using Cosmos.Compiler.Assembler.X86;
|
|
|
|
namespace Cosmos.Compiler.XSharp {
|
|
public class AddressDirect : Address {
|
|
public readonly string Label;
|
|
public readonly uint Address;
|
|
public readonly RegistersEnum? Register;
|
|
|
|
public AddressDirect(RegistersEnum aRegister) {
|
|
Register = aRegister;
|
|
}
|
|
|
|
public AddressDirect(UInt32 aAddress) {
|
|
Address = aAddress;
|
|
}
|
|
|
|
public AddressDirect(string aLabel) {
|
|
Label = aLabel;
|
|
}
|
|
|
|
public override string ToString() {
|
|
if (Label == null) {
|
|
return Address.ToString();
|
|
} else if (Register != null) {
|
|
return Registers.GetRegisterName(Register.Value);
|
|
}
|
|
return Label;
|
|
}
|
|
|
|
}
|
|
}
|