5 ms·
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 th
by antimagic 12y ago
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.
- blt 12y agoCaches 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-85_funcChar_Jun68.pdf http://www.bitsavers.org/pdf/ibm/360/funcChar/A22-6916-1_360..., see references to "buffer storage" [2] http://www.pdp-11.nl/pdp11-70startpage.html http://www.pdp-11.nl/pdp11-70startpage.html
- to3m 12y agoNot 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).