Error

Johann johann.lermer at elvin.eu
Mon Oct 31 11:23:36 UTC 2022


```d
writeln (getSize(rom))
```
reports 478 bytes but since you work with ushorts (why? as far as 
I can see, this is a 8 bit machine) you convert the read(rom) 
into ushorts, which is only half in size:

```d
writeln (cast(ushort[])read(rom));
```

gives you 478/2 = 239 bytes

```d
this.memory[memStart..memStart + romSize] = 
cast(ushort[])read(rom);
```

fails because both ranges have different sizes.


More information about the Digitalmars-d-learn mailing list