Remix.run Logo
JdeBP 3 days ago

There was no self-modifying code. BBC BASIC was in ROM.

classichasclass 3 days ago | parent [-]

I don't know the internals of BBC BASIC, but many Microsoft-derived BASICs do keep track of the current location in the program text with self-modifying code; the routine is copied to a reserved portion of zero page on 6502 machines for speed. On the C64 this routine lives at $0073 and the pointer is at $007a. Because it's in RAM, this makes it a popular location for wedging in additional behaviour or commands (hence the term "wedge" for such extensions). On some systems like the PET, this was the only way to accomplish it.

JdeBP 3 days ago | parent [-]

BBC BASIC is not Microsoft BASIC. You cannot reason about the operation of BBC BASIC from only knowing about Microsoft BASIC.

Whereas I suspect that I am nowhere near the only person on this page who once disassembled ROMs on a BBC Micro. We can state, in contrast, that there was no such self-modifying code. Again, BBC BASIC was in ROM.

Those lucky enough to have a copy of Jeremy Ruston's book after all of these years, or the retrocomputing enthusiasts who still have working Beebs, could even tell you exactly where in ROM the code was that fetched the next token for execution.

I never actually owned a copy of the book, and somewhat envy anyone who still has a copy; although to compensate I do have part of one of my own disassembly listings still, buried somewhere. (-:

classichasclass 3 days ago | parent [-]

I made no claim it was. I was pointing out that ROM BASICs on 6502s have kept track of the current pointer in self-modifying code by copying the relevant section to RAM. Just because it originated in ROM doesn't mean it doesn't. Thank you for explaining the situation with BBC BASIC.