public UInt32 Read_32(PeripheralObject Object, UInt32 Address) { if (Address % 4 != 0) { throw new UnalignedMemoryAccessException(Address); } if (Object.Range.Contains(Address, out var offset)) { return(Object.Read_32(offset)); } throw new UnhandledFetch32Exception(Address, Object); }
public UnhandledFetch32Exception(UInt32 Address, PeripheralObject obj) : base(Message(Address, obj)) { }
private new static string Message(UInt32 Address, PeripheralObject obj) { return($"0x:{Address:X} is out of {obj.ToString()} range."); }