46

They were awfully slow. And not just because the CPUs they ran on were slow; the interpreters themselves tended to use some terribly inefficient implementation techniques that certainly wouldn’t pass for good practice today: Where a modern programming language interpreter might use a just-in-time compiler or convert the program into bytecode before running ...


46

The speed of BASIC interpreters has been discussed elsewhere on this site, see How can you measure time using BASIC on Atari XL computers? for example. They were slow, in many cases very slow; bear in mind that micros in the 80s had slow CPUs, small amounts of memory, and most BASIC implementations were interpreted. Even BASIC on PCs was slow (at least, ...


27

You can actually try out these programs on a real-speed computer of that vintage using jsBeeb or, for a more convenient program editing environment, bbcmic.ro. To make the above programs compatible with BBC BASIC, change LPRINT to just PRINT, and add a line at the beginning reading DIM L$(4). I found that the published program took less than a second to run, ...


27

I can speak from experience of having tried using the manual hinting. I work on a large mathematical modeller and when the Intel IA-32 hinting system described in the reference appeared, my management was keen to try it. The codebase is far too large for manual hinting of every if/then/else to be practical, and there is no single "core algorithm" ...


22

Implicit forward-not-taken, backward-taken hinting is almost as effective as an explicit indicator. (A backward branch that is usually not taken — single pass loop — could not be encoded and a simple if conditional that is false often enough to prefer forward taken but not false often enough justify extraction, which would typically require an additional ...


17

the drive could end up only being able to transfer one bit per horizontal blank = 63 microseconds. 1/(63e-6) = 15873 bits/s = 1984 bytes/s. That would be the bitrate during transmission within a byte, but bytes are framed and handshaked, which adds an average of 160 µs per byte. Resulting in (63 * 8) + 160 µs, or ~664 µs per byte. So the upper transfer sped ...


14

TL;DR: It was a limited solution to bridge a gap in chip development. There was a small window of usefulness between the time chip technology was capable to support a CPU with pipelines long enough to create a failed prediction penalty (i.e. the wrong sequence fetched) but not providing sophisticated branch prediction units (and data storage) and the time ...


14

Not a complete answer, but a bit of information from the manual (for several Novas including the 1200): The hardware multiply-divide option for the Nova is actually a peripheral device connected to the in-out bus, although it has no flags or interrupt capability. It contains A, B and C registers, which are loaded and read by the standard IO transfer ...


13

For a program as small as this, optimization doesn't matter. But ... IMO the main reason the first version is hard to read is not the optimization, but keeping track of the statement numbers in the GOTO statements. Every more modern programming language has some type of "IF ... THEN ... ELSE ... END IF" statement which makes the labels unnecessary. ...


10

BASIC interpreters on 8 bit microcomputers are miraculously performant within their context. You might think it sounds crazy to take a 1 or 2 MHz machine and bog it down with an interpreter, and one that doesn't even translate code into byte code! These BASICS were just tokenize for more compact storage, but otherwise interpret at the token level; the ...


10

Your version is dramatically slower. I did minor changes to get it to run on Atari BASIC simply because I can cut and paste code into my Atari 800 emulator. I added an internal timer, that's the PEEKs at the top and bottom. Here is my version for the first example: 9 ST=PEEK(18)*65536+PEEK(19)*256+PEEK(20) 10 REM ANAGRAMME 15 DIM A$(4) 20 INPUT A$ 30 PRINT ...


10

In general most instructions on the 6500 series take as many cycles as there are memory accesses, with a lower limit of two. This means no instruction will execute in less than two cycles (*1). The mentioned ADC gives a nice example, as it offers almost all addressing modes: Mode Example Length | Cycles ...


9

Assuming you’re asking: what can the 6502 be seen to be doing by an external observer, then the data sheet has a full breakdown of bus activity per cycle per addressing mode; that was long ago transcribed into ASCII form by the Commodore community and is now often sourced from that 64doc.txt. Do a search in that document for “Instructions accessing the stack”...


9

Interpreters were slow and programs like this that you typed in were not expected to be fast. It's doubtful the program was optimized for speed. You were trained to think of readability in terms of structured programming on a large screen. No gotos allowed. In this era, gotos were expected and ubiquitous. They feel unreadable to you, but I still see ...


9

What's the question? First problem here is what is to be considered speed. Random access time? Cycle time? Maximum memory thruput? Average memory thruput? Either value per chip or for the whole memory subsystem? For the following I'll go with maximum memory band for the whole memory subsystem. That is when a memory page is opened and successive access is ...


8

I don't think that this is fundamentally a question about BASIC interpreter design: it is fundamentally a question about math. Your code is very slightly easier to understand, but at the cost of a ton of extra work. You code goes through all 44 = 256 possible values of I1, I2, I3, I4. Only 4! = 24 are actually permutations, so in some sense your code is only ...


8

When you ran these two programs, did you do it on actual, vintage hardware (or same emulated at vintage clock speeds) or did you run the BASIC on modern gigahertz CPUs? The very poor performance of CPUs of the day forced you to redefine your definition of "elegance". Your concept of "elegance" is "CPU is cheap/free, especially if it'...


6

From Rodrigo Copetti’s analysis, The RDP relies on 4 KB of TMEM (Texture memory) as a single source to load textures. Unfortunately, in practice 4 KB happened to be insufficient for high-resolution textures. Furthermore, if mipmapping is used, the available amount of memory is then reduced to half. As a result, some games used solid colours with Gouraud ...


6

“… many professionals and computer enthusiasts criticized BASIC for its simplicity, how it handled tasks, and the way in which it did not maximize or fully utilize the power of the computer itself. However, those criticisms missed the point completely.” (from Rankin, Joy Lisi. A People’s History of Computing in the United States Harvard University Press, ...


3

TL;DR Before the use of integrated circuits in computers, the technology was so completely hamstrung by available component technology that it only proceeded at a "glacial pace" measured in decades and centuries. To be historically accurate, you first have to acknowledge that "computing machinery" has been around for many centuries. The ...


3

To a certain extent, yes, there was rapid obsolescence. This is why, for example, many computers were leased rather than purchased. Two of the computers I used at university, the EE KDF9, and the ICL 1906A, had operational lifetimes by my estimation of about 7 to 8 years. They were both obsolete by the time they were replaced. Looking at ICL as a particular ...


3

Different versions of BASIC supported different control structures. The program was most likely written to be understandable by anyone who understood any dialect of BASIC, regardless of which particular dialect it was. There are many ways the program could have been written that would be more readily understandable to people familiar with some dialects, ...


3

Do not confuse "fast" in terms of bandwidth (bytes per second) with "fast" in terms of latency (nS from beginning of address request till when bytes are in cache). Rambus used a highly serialized protocol that required multiple clocks to even start a transaction, and more clocks to transmit the address values. Thus the combination of the ...


3

In the 1st half of the 1980's when both processors were past their initial flaws, the generally accepted wisdom was that general purpose PCs based on a 6502 (e.g. an Apple IIe, Commodore C64, et. al.) were faster or otherwise more capable than ones based on a Z-80 (e.g. Radio Shack TRS-80). The conventional wisdom reversed for embedded systems. For the ...


3

Personal and home computers have improved with computer technology in general over the last 40 years or so. Over the period of 1990 to 2005, the technology underlying personal computers, particularly the family that started as "IBM PC compatible", became the main platform for all computing. Most servers and even supercomputers over the last ...


2

The length of the ADC Immediate is 2. One for the opcode $69 and one for the immediate. At the very least, this requires two bus cycles to fetch. On a "simple" processor, an instruction can't take fewer cycles than the number of bus cycles that need to be performed to do the work of that instruction.


2

I ran your code in the VICE Commodore 64 emulator. I only added two lines 25 TI$="000000" and 145 PRINT TI/60 to display the execution time in seconds (not including the time the program sits there waiting for user input). Also I changed LPRINT to plain PRINT (as C64 BASIC has no LPRINT command) and removed some spaces from line 90 of your version, ...


2

So here is my question. How fast would BASIC interpreters work on typical home computers in the 80s. Would you feel a noticeable difference between the two programs in execution time. I typed both programs into my Mattel Aquarius, which is a fairly typical 80's 8 bit home computer with a 3.58MHz Z80 and Microsoft BASIC. I don't have an RS232 serial printer ...


1

The theory To me, just like to several other responders to your question, this is first and foremost the question about algorithmic complexity. The program from Eco's book generates all permutations of the 4 letter input. There are actually two types of permutation generators: with and without repetitions. The difference matters because there are much fewer ...


1

The main issue is that back then, everything about computers felt very limited (and, obviously, also was limited). It was easy for a kid to run out of RAM for their BASIC programs. I wrote several programs back then on an Atari 800 XL which ended up with simply not being able to add more lines. On the assembler level, memory was paged in 256 byte pages - so ...


Only top voted, non community-wiki answers of a minimum length are eligible