コード例 #1
0
        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);
        }
コード例 #2
0
 public UnhandledFetch32Exception(UInt32 Address, PeripheralObject obj) : base(Message(Address, obj))
 {
 }
コード例 #3
0
 private new static string Message(UInt32 Address, PeripheralObject obj)
 {
     return($"0x:{Address:X} is out of {obj.ToString()} range.");
 }