Lies in education [was Re: The "loop and a half"]

Steve D'Aprano steve+python at pearwood.info
Fri Oct 13 06:37:18 EDT 2017


On Fri, 13 Oct 2017 05:16 pm, Gregory Ewing wrote:

> Steve D'Aprano wrote:
>> On Fri, 13 Oct 2017 03:37 pm, Gregory Ewing wrote:
>> 
>>>If the compiler can tell where p is initially pointing, it could
>>>put the pointer in read-only memory.
>> 
>> If it's read-only, how can the compiler write to it?
>> 
>> (I come from the days when ROM was actual ROM, burned in at the factory.)
> 
> So, the factory is allowed to write to it. Possibly
> it's writing data that came from... a compiler?

The data could come from anywhere, including a scanner:

https://hackaday.com/2012/08/24/uncovering-easter-eggs-in-old-mac-roms/

I wasn't questioning where the data came from, but how the compiler can write
to READ ONLY MEMORY which might not even be in the same continent as the
compiler that generated the code.

Read-only memory (ROM) is typically burned into the silicon by the integrated
chip manufacturer at the factory:

https://en.wikipedia.org/wiki/Mask_ROM

or written by a dedicated hardware device:

https://en.wikipedia.org/wiki/Programmable_read-only_memory

Whether the data is burned into the silicon or electrically written by a
dedicated device, it isn't written by the compiler, and once written the data
is permanent.


> A memory that couldn't be written to at all, ever, would
> be a bit useless!

Macs used a ROM for at least a decade and probably more. The ROM contained
data such as mouse cursors, toolbox routines, icons, sounds, and a
bootloader. No Mac was capable of writing to their ROMs any more than they
could write to their mouse or a CD-ROM.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list