OT - Memory usage in days of yore
Georg Wrede
georg at nospam.org
Thu Apr 10 15:03:32 PDT 2008
Janice Caron wrote:
> On 10/04/2008, Georg Wrede <georg at nospam.org> wrote:
>
>> 16k ROM, and either 16k or 48k RAM, according to
>> http://en.wikipedia.org/wiki/Sinclair_ZX_spectrum
>
>
> That was the Spectrum, a different machine, and a couple of years
> later. We're talking ZX80 here.
>
> Course, we didn't have the internet back in those days. Hell, we
> hardly had computers! But this link should shed some light.
> http://computermuseum.50megs.com/brands/zx80.htm
Ah, ok.
Well, I had a grand 3.5k on my VIC-20.
The biggest advantage to having a ridiculously "small" computer was,
that one would learn it through and through. I remember knowing the
memory map by heart, the locations of every system variable, and also
the entire circuit diagram. Haven't done that with any of my later
computers.
It also used the 6502 processor, which was more primitive than the ZX-80
and it only hand the registers x, y, a, status, stack pointer, and
program counter. When other processors had auxiliary registers, the 6502
used 128 bytes of memory at the beginning of the address space. The
stack was limited to the next 128 bytes.
Interestingly the stack (one-eighth of a k) was shared between the
system, the interpreter, and user programs. At the time I was amazed at
how things didn't get mixed up. Today I'm amazed that you can do
anything with a stack that small. The size was not adjustable because
the processor used special, fast instructions to address the first 256
bytes of memory.
For this computer I wrote a multitasking process that visualized the
contents of arbitrary memory areas during running of other programs, in
real time. I wanted to do that for two reasons. First, it was a major
challenge: there was no reason to expect that I could pull it off.
Second, I wanted to see "what actually happened" inside the computer
when it was running programs. I'm a visual kind of learner.
I used the program to study stack allocation, storage of Basic programs
in the program area (and to learn how they were stored in compressed
form -- you have to remember, at the time bookshops didn't carry
computer literature, let alone something VIC-20 specific. Not to mention
we didn't have WWW, or even modems), heap activity, and activity in
system variables. Oh, man, who needs sleep or food with this stuff!
I didn't have an assembler, nor even a Monitor program. But then I
didn't really mind. The assembler for 6502 was so easy to learn and use,
that I did it all on pieces of scrap paper or backs of envelopes. And it
was very easy to relocate the code, especially if you avoided using
absolute addresses to within the code.
Oh, and I didn't have any books about it. I found a listing of the asm
commands in an appendix, and that was that. I guess I'm lucky, a more
complicated instruction set could have been too much.
Years later, when I already had a CP/M Office Computer (as opposed to a
toy), the Kaypro-II, I found a mail-order bookshop in a german computer
magazine, where I bought the complete and annotated listing of VIC-20
firmware (bios and basic roms). I learned a lot from that too. Heh, and
German computerese isn't that hard to understand. There's a certain
feeling when you've read the entire rom listing. You sort of feel
there's something you know through-and-through.
More information about the Digitalmars-d
mailing list