Re:Sweet 16: The 6502 Dream Machine (1977)
by antimagic on Monday March 02, 2015 @10:20AM
(#9132179)
Hah, my first though on reading this was that the software stack implementation must slow the machine down horribly. Then I remembered that this was back in the day before cache memory and other optimisations existed, making the technique close to comparable to using the hardware-implemented stack.
[ Parent
| on HN ]
Caches existed, just not in microprocessors. The IBM 360 model 85 introduced caches in 1968 [1]. The DEC PDP-11/70 had one in 1975 [2], the same year the 6502 debuted.
The Motorola 68020 was the first Motorola microprocessor with a cache in 1984, and the 386DX was Intel's first in 1985 [Wikipedia].
I agree, it's kind of shocking to read about the designs people could get away with before caches became important. It also illustrates why it's so important to continually re-evaluate any programming doctrine related to performance and data organization.
[1] http://www.bitsavers.org/pdf/ibm/360/funcChar/A22-6916-1_360..., see references to "buffer storage"
Not so - this routine actually takes a long time by comparison, and I've no doubt the execution will be shamefully slow :) To push 16 bits to the hardware stack on the standard 6502 takes 8 or 9 cycles (depending how you retrieve the second byte); this routine takes 50 (as a round trip including the JSR).