Enforced immutability: Difference between revisions
→{{header|6502 Assembly}}: revised entry
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) (→{{header|6502 Assembly}}: revised entry) |
||
Line 11:
=={{header|6502 Assembly}}==
{{trans|Z80 Assembly}}
The 6502 has no hardware means of write-protecting areas of memory. Code and/or data are only immutable if they exist in ROM. Typically, a program run from floppy disk or CD-ROM is copied to the hardware's RAM and executed from there, while ROM cartridges (such as those on the NES) are often mapped directly into the 6502's address space and executed as ROM.
<lang 6502asm>bit7 equ %10000000▼
byte $01,$02,$03,$04,$05</lang>
Labeled constants are also immutable, as the assembler replaces them with their equivalent values during the assembly process. The 6502 isn't aware those labels ever existed.
<lang 6502asm>bit_7 equ $80 ;every instance of "bit_7" in your source code is swapped with hexadecimal 80 during assembly</lang>
=={{header|68000 Assembly}}==
|