Enforced immutability: Difference between revisions
→{{header|Z80 Assembly}}
Puppydrum64 (talk | contribs) m (→{{header|6502 Assembly}}: clarification) |
Puppydrum64 (talk | contribs) |
||
Line 1,303:
8
</pre>
=={{header|Z80 Assembly}}==
The Z80 itself has no way of enforcing immutability. Code and/or data are only immutable if they exist in ROM (read-only memory.) Typically, Z80-based computers will copy the contents of a floppy disk or CD-ROM to internal RAM and execute it there, whereas ROM cartridges are directly mapped into the Z80's address space and executed in ROM. As a result, there is no special syntax for enforcing immutability, as it relies entirely on where the code/data is located and what medium it is executed from.
Side note: Trying to write to ROM at runtime will simply have no effect, and will not raise any kind of hardware exception or segfault.
<lang z80>List:
byte 2,3,4,5,6 ;this could be either mutable or immutable, it depends on the hardware.</lang>
=={{header|zkl}}==
|