84

There are a lot of retro-computers with BASIC as an integral part of the operating system. The IBM 5100 was one of the first computers with a separate memory space for BASIC, followed by the Commodore PET, Apple II and TRS-80.

But why was BASIC built into their operating systems, using memory? From this memory map, the Commodore 64 had memory completely reserved for BASIC. There were computers, like the Altair 8800, that provided BASIC as software that could be loaded into memory when necessary, and these computers both worked and sold well.

So why was BASIC built into so many computers' operating systems?

wizzwizz4
  • 18,543
  • 10
  • 78
  • 144
  • 14
    I don't know the answer to your question, but I thought it useful to point out that in many 8-bit systems (at least, those with 64KB of RAM), the BASIC ROM can be disabled. Thus on the C64, bits 0 and 1 of the byte at address 1 in memory need to be set to 1 for the BASIC ROM to be visible, otherwise RAM is available in the BASIC area (A000-BFFF). 8-bit Ataris have a similar mechanism. – Stephen Kitt May 11 '16 at 20:32
  • 7
    @StephenKitt Now that is clever. I suppose there isn't as much downside to having it on there if you can disable it like that, so it's more of a case of "why not?". – wizzwizz4 May 11 '16 at 20:37
  • 7
    Exactly — but why was BASIC expected to be provided on computers then? That's an interesting question too... (The expectation lasted quite a long time, even early IBM PCs had BASIC in ROM, and of course MS-DOS provided GW-BASIC and later QBASIC.) – Stephen Kitt May 11 '16 at 20:43
  • @StephenKitt Same in the MSX, and I guess that in all those 8 bit machines as well. – Konamiman May 12 '16 at 08:49
  • 2
    Have you considered what the alternative could have been in the 8-bit world? – Thorbjørn Ravn Andersen May 12 '16 at 16:13
  • 2
    @wizzwizz4 Sorry, it was a joke based on assuming the identity of the poster is John Taitor, a rumored time traveler that come to our present from the year 2036 to retrieve a IBM 5100 computer, funny enough the model the poster was asking about. https://en.wikipedia.org/wiki/John_Titor – EChan42 May 12 '16 at 16:20
  • 1
    @EChan42 Oh. I get it! d:-D – wizzwizz4 May 12 '16 at 16:20
  • 1
    What language would you recommend to a beginner these days? Back then the answer was obvious! – joeytwiddle May 13 '16 at 08:11
  • 1
    @joeytwiddle Yes, very obvious, and the answer was unambiguously Pascal :-). Ease of implementing, small ROM footprint and later inertia caused by de facto standards is more like the real reason – Radovan Garabík May 13 '16 at 08:28
  • 14
    in many cases, BASIC *was* the operating system... – Radovan Garabík May 13 '16 at 08:31
  • 15
    If basic was not provided, what did you expect people to do to get software? Buy it? From whom? People that programmed huge commercial machines? No, it had to be possible to make your own programs, right away. – doug65536 May 17 '16 at 10:10
  • 2
    @doug65536 Consider posting that as an answer. – wizzwizz4 May 17 '16 at 15:15
  • Windows 10 also has Basic built in... – Anixx Jun 28 '18 at 13:49

18 Answers18

71

Having a programming language built-in gave you a multi-purpose tool into your hands at the flick of a switch (power on).

As to the choice of BASIC vs. other programming languages, microcomputer BASIC dialects are - despite some of their shortcomings - quite accessible to novice programmers. They are a bit like using English in an imperative style ("PRINT this", "DO that"), so not hard to learn. There was a lot of BASIC literature around at that time and sufficiently general example programs could be ported to different systems without too much work. Many other languages are more cryptic to someone not used to it.

As they were usually included on the ROM chips, they didn't take away any RAM if you chose not to use BASIC.

blubberdiblub
  • 2,031
  • 17
  • 18
  • 19
    Keep in mind that these computers didn't have an OS (like today's). You turned it on, and wanted to do stuff, but there was no "command interpreter" by default. What you had was a cursor. If you wanted to run something like a batch file you needed an interpreter. BASIC served that function. Think of it less as a language and more like a set of built in commands. – coteyr May 12 '16 at 19:20
  • @coteyr well, it's both. And granted, on most microcomputers the BASIC was essential as a shell if you didn't have expansions that replaced it. But I also used microcomputers whose main and initial shell was not BASIC and which still had a BASIC ROM built-in (KC 85/3 and KC 85/4). – blubberdiblub May 12 '16 at 20:10
  • 1
    And my main point is that they could have chosen a different language as shell or otherwise, like FORTH for instance, but they chose BASIC for its ubiquity at the time and its simplicity. – blubberdiblub May 12 '16 at 20:20
  • 4
    Yeah I agree with that. I would rather write a few statements in BASIC then FORTH or ASM or just about anything else available at that time. – coteyr May 12 '16 at 21:11
  • 1
    That awkward moment when you realize your entire life, you've taken disk access from command line for granted... – corsiKa May 13 '16 at 21:04
  • 5
    @crosiKa, you have it all wrong, You take disk access for granted. This things didn't have any kind of perminate disk. ROM and a floppy was common. Man man was that floppy floppy. – coteyr May 14 '16 at 02:33
  • 5
    @coteyr "Think of it less as a language and more like a set of built in commands" Exactly! That's the role Bash for example fills for a lot of *nix systems nowadays. I think most systems that didn't use BASIC had some kind of alternative. – Kevin May 15 '16 at 08:01
  • 6
    @coteyr of course, many of them didn't even have floppies, just tapes. Tapes that you played using an ordinary audio casette deck, complete with screechy noises as the data stream came out through the speakers. – N. Virgo May 15 '16 at 11:15
  • 2
    It was very common in the late 70s and 80s for non-computing professors at universities to write their own software for testing and research. I used to support and upgrade these programs into C once they were happy with the general idea they had coded in basic. – Matthew Lock May 16 '16 at 23:36
  • @Kevin you're quite right to draw the analogy with *nix - and they too usually come with a plethora of compilers and interpreters, often pre-installed, for the same reasons: you turn on the system and make your own. – Konerak Oct 10 '16 at 11:40
  • Highlighting its accessibility, it's worth mentioning that BASIC stands for "beginner's all-purpose symbolic instruction code". – Jason C Mar 06 '17 at 06:34
  • 2
    BASIC was available and generally usable to most people. Books with BASIC listing of games were available for typing in. Computers with other default languages did not sell quite as well. See for instance https://en.wikipedia.org/wiki/Jupiter_Ace which had Forth. – Thorbjørn Ravn Andersen Feb 20 '18 at 21:20
  • BASIC may have been on ROM chips rather than in RAM, but it still occupied part of the machine's memory map. For an 8-bit CPU, that'd be 64k, so an 8k BASIC ROM represent one eighth of the addressable memory space. – Kaz Aug 29 '19 at 17:10
46

Having BASIC available for the machine was a selling point so early adopters wouldn't have to wait for software to become available--they could write what they need themselves, and they wouldn't need to learn machine language to do it.

[Bill] Gates believed that, by providing a BASIC interpreter for the new [MITS Altair] computer, they could make it more attractive to hobbyists.

snips-n-snails
  • 17,548
  • 3
  • 63
  • 120
  • 4
    I can remember in the late 70s that owning a computer at all was a big deal (much like 3d Printers in 2016), and that initially all you wanted one for was programming yourself. It was a few years later that the software available for that particular computer really mattered. – Matthew Lock May 16 '16 at 07:04
  • 2
    @MatthewLock And "coincidentaly", Microsoft was one of the first companies that made consumers buy software - with the exception of specialized software, the standard was "the software comes with the computer". Want a better software suite? Buy a better computer! – Luaan May 16 '16 at 15:33
  • 5
    It wasn't just a selling point to the users, it was a selling point to the people providing the funding: as a child of the '80s you wanted your Spectrum or Commodore to play games, but because it started up in a serious programming environment, that meant it was educational and would definitely lead to a high-paying career. This is what we told our parents. – Tommy Oct 24 '17 at 16:05
42

Nobody so far has said the magic words, which is Microsoft BASIC. First developed for the Altair 8800 (the first commercially successful personal computer!), Microsoft spent a lot of energy making sure their BASIC would work on every personal computer in the 1970s and licensing it widely. It ran on CP/M, it ran on the TRS-80, and -- of course -- the IBM PC. Apple's AppleSoft BASIC, Commodore BASIC and Amiga BASIC were all originally licensed from Microsoft. This meant that if you were manufacturing a personal computer in the 1970s, the first question any customer would ask was whether their existing Microsoft BASIC programs would work on it -- essentially, the first standardized programming language/execution platform!

Gaurav
  • 523
  • 3
  • 6
  • 1
    "Standardized" might be taking a bit far, given the degree of customization on different platforms. OTOH, http://stackoverflow.com/questions/31877835/ – fadden May 12 '16 at 16:44
  • 5
    Also, and perhaps more important, the original Dartmouth BASIC was fairly early made available to the world for "free". – user2338816 May 13 '16 at 00:08
  • 2
    ZX81 and BBC B where the most common computers in the UK at the time, and they did not have Microsoft Basic. – Ian Ringrose May 16 '16 at 11:06
  • 2
    @IanRingrose - The CPC464 outsold the BBC B by some margin, but also didn't have Microsoft BASIC (despite its OS being based on CP/M IIRC, which would have made Microsoft BASIC the natural choice). – Jules May 16 '16 at 16:49
  • @Jules, if I recall correctly the CPC464 was most sold/used as a video game system. I don't think many people used the basic on it. – Ian Ringrose May 16 '16 at 17:04
  • cpc did come with basic. it just wasn't microsoft basic, so there's that. – Lassi Kinnunen May 17 '16 at 05:46
  • 1
    Yes. Microsoft is actually the reason BASIC became a standard on home computers; they ported their BASIC to pretty much everything and got it built into a lot of stuff. In fact, the source code for Applesoft BASIC actually has an EQUate at the top of the assembly which you can change the value of to build Commodore BASIC instead (although whether or not it still worked by the time I got a look at it, I don't know). :) – Eric Shepherd May 17 '16 at 21:44
  • I think you will find COBOL (from 1958) as the first "standardized programming language/execution platform". (Algol58 was an attempt but it had no actual success). – Ira Baxter Aug 23 '17 at 21:39
  • @IraBaxter That's true, but I don't think that's the same sense in which I think of Microsoft BASIC as being a standardized programming platform. With COBOL, I'm not sure many devs were targeting ANS-COBOL: most would be written for particular hardware, and then translated to others if there was a business need. But BASIC developers could target MS-BASIC, and Microsoft would try to make sure input code worked the same everywhere. This allowed e.g. https://en.wikipedia.org/wiki/Type-in_program in a way that you didn't see elsewhere. But I might be wrong :) so thanks for your comment! – Gaurav Aug 24 '17 at 01:01
  • @IraBaxter I'm also not sure if COBOL was as standardized as people like to think, e.g. http://www.sciencedirect.com/science/article/pii/0167805184900032 suggests that easy portability didn't hit until the 1980s. – Gaurav Aug 24 '17 at 01:03
  • 3
    @Guarav: It was/is a helluva lot better than the 6000 BASICs that appeared in the late 1970s and early 80s. Even the MS BASIC clones were only "sort of" compatible at best. – Ira Baxter Aug 24 '17 at 01:05
  • 1
    Also it ran reasonably well, and was for all practical purposes bug free. – Thorbjørn Ravn Andersen Feb 20 '18 at 21:21
26

Thraka is right that BASIC served the role of operating system on many 8-bit micros. Some OS was needed, that was beyond doubt. But at the time dedicated operating systems were either very limited (say, Atari DOS), overly complex, big and expensive for the tiny computers (Unix), or - for the middle ground, that was "just right" - in their infancy (CP/M).

BASIC, on the other hand, was touted THE beginner's programming language.

At the time - 8-bit micros were primarily aimed at the kids and teens market. They were "home computers", where the dad could write and print letters, mom could design crosstitch images, but 90% of the time kids would be playing games. But if the computer was to be more than a glorified gaming console with hardly-used extra functions, it needed a marketing point that would set it apart from the consoles: "It Teaches Your Kids Programming" was the critical sales point. And so it needed a kid-friendly programming language.

BASIC had only one serious competitor for that position at the time: Logo, and while Logo was generally considered a much better learning tool* but it hardly yielded towards "general use" - you could do some quite fancy stuff easily (drawing a Koch Snowflake was less than a screen long program; not a packed screen too) but didn't yield well towards "common use", and was considerably slower. Other languages than the two either employed concepts too advanced for kids, or were too complex to implement on 8-bit micros (leaving enough memory for actual software too!).

...also - Microsoft Basic was an important language for "professional environment". Learning its simpler variants was considered (usually by clueless parents) an important building block towards building a career of using it professionally. Nobody ever wrote serious business software in Logo. Therefore the marketing appeal of Basic - despite its factual shortcomings - overshadowed Logo as THE language for learning.

On top of that, implementing OS procedures as BASIC commands was simple, natural and took little effort, little memory and allowed to integrate or script them as BASIC programs easily. Logo didn't yield itself to that purpose nearly as well.

And so, BASIC being simultaneously a comfortable OS environment, a scripting tool, a teaching tool, and - above all - an important marketing point - became the language of choice.

* (e.g. providing recursion, which was between very difficult and impossible in Basic, lacking local variables, parametric function calls and rarely implementing easy to access arrays which could serve as a crutch for these). Also, the Turtle Graphics, which was excellent for teaching the concept of "giving commands", and building a library of procedures, but made utilizing the gfx as "pixel canvas" difficult.

SF.
  • 7,095
  • 7
  • 30
  • 58
  • 2
    Note that Logo was explicitly designed to empower students and be a great learning tool. Basic was intended for computer users, not students - most people just did something like LOAD followed by RUN and that's it (similar to how most people only used CD in MS-DOS :D). Logo was for fun and learning, not for people training to be programmers specifically. – Luaan May 16 '16 at 15:37
  • 1
    @Luaan: theoretically one could do the same in Logo. You won't convince me any professional with two bits of technical knowledge would consider Atari or Spectrum BASIC for any serious application - but it was the buzzword of the time; Microsoft BASIC was used in serious applications and the usual customers for home computers wouldn't know the difference. "What will my son know if he learns Logo? It's a toy for children! Nobody uses Logo for anything serious! But BASIC! There's business software written in BASIC! BASIC programmers earn big money!" – SF. May 19 '16 at 17:50
  • Of course you could - but why? There's no need for the extra complexity and the extra memory required etc. - BASIC did the job, and was exceedingly simple for the computer. One of the big reasons LISP machines "failed" was that they were simply too expensive, and I assume that the LISP-derived Logo had the same problem. Now, LISP was great for development, but Basic was very good for application development - applications could be made quickly and cheaply and got the job done, and that's what the users cared about. This was further cemented in MSVB, of course – Luaan May 20 '16 at 06:10
  • 1
    @Luaan: I'm not sure how "big" the Basic implementations were, but I know Logo was fairly small, so the concerns fo "extra complexity and memory" don't really apply to anything with more than 16KB of RAM. And it was a real challenge to run out of RAM unintentionally (other than memory leak like 10 GOSUB 10) in either of these on 64k machines. – SF. Dec 08 '16 at 16:50
  • 1
    @SF. A "computer" professional would not consider any BASIC for serious applications. However, a serious non-computer professional could, and did. In the early 80's I had a programming contract where the client insisted, non-negotiable, that the entire project be in BASIC. I was able to "upgrade" that to complied BASIC, but that was it. Reason: he could "read" the program, where as in Pascal he couldn't understand it. Bottom line, a serious programmer spent time doing serious programming in BASIC. That or pass on a $30K (in 80's dollars) contract. –  Mar 09 '17 at 03:06
  • @GypsySpellweaver: platform? – SF. Mar 09 '17 at 06:01
  • IBM PC XT (clone), 8086, 640KB RAM, 20MB HDD, 2x 5¼ 360KB FDD, some kind of modem, and some style of LAN. Don't recall either of the communication cards, but the modem was for data transmission/retrieval at USDA, and the LAN was for connecting 'terminals' in the production areas to the main computer (server) in the front office. –  Mar 09 '17 at 06:28
  • @GypsySpellweaver: then your typical professional computer, witf BASIC dialects for professional use. Lots of business software written in BASIC was running on the likes. I was talking about Atari or Spectrum or other home 8-bit computers. – SF. Mar 09 '17 at 06:36
  • @SF Short of needing the contract I wouldn't have considered any BASIC, and still wouldn't, for serious programming. Even when using an IBM 5100 I insisted on using APL over BASIC. [That was fun :-) ] –  Mar 09 '17 at 06:40
  • 4
    Serious computer professionals in the 1970s built highly capable BASIC systems. (I built a PASCAL like version of BASIC with real subroutines/functions, 24x80 screen device-independent screen management and complete access to all OS-provided services back then; this was compiled to what amounted to a PCODE. With tools like that you could write quite serious applications. And people did. – Ira Baxter Aug 23 '17 at 21:42
22

As far as I know it was included because it was essentially the operating system interface. When you installed MS-DOS on a PC it provided you with commands and allowed you to run programs that executed machine code on the machine.

BASIC back then was similar. It provided you with a command prompt, operating system-level commands like reading/writing data to disk, a printer, tape, do simple things like print to the screen, and read in user input.

This way you had a general set of commands with an interpreter that could be ported to other CPUs and memory configurations with minimal changes. You just needed to setup which commands were available and what machine specific code was run for those command.

Essentially a portable, programmable, operating system.

Thraka
  • 2,913
  • 1
  • 17
  • 37
  • 2
    I think it's a misnomer to say that you "installed" MS-DOS on an early PC. MS-DOS 5.00 was the first version that was sold outside of OEM channels, and at least up through MS-DOS 3.x, it was common for machine-specific changes to be made to the operating system core which meant that you couldn't take a MS-DOS intended for an Amstrad, run it on a Compaq, and expect it to work. For the Amstrad you might need Amstrad DOS, and for the Compaq you might need Compaq DOS, which were both MS-DOS with minor changes (same commands, etc.) and could run all (well-behaved) MS-DOS/PC-DOS compatible software. – user May 12 '16 at 16:35
  • 5
    Additionally, until hard disks became a common PC accessory, you didn't really "install" any software on the computer... you swapped floppy disks. Which were usually floppy back in those days. (5¼" floppies.) – user May 12 '16 at 16:35
  • Yeah but what about installing CP/M on the machine? And the part of "when you" could easily refer to a manufacturer. Businesses easily ran PCs with hard drives while consumers generally didn't until they became more affordable. I was using it as a general example :) Further, if it's installing to memory (boot disk startup) versus a hard drive (perm install), it's the same principle. – Thraka May 12 '16 at 17:20
  • 2
    On the BBC Micro, other ROMS made use of the "library" routines that were available on the BASIC ROM, e.g. for printing strings or numbers. So that was a secondary benefit from its presence. – joeytwiddle May 13 '16 at 08:13
  • @joeytwiddle I've heard of machine code programs running from ram doing that but it seems unlikely that other roms would. The BBC micro's memory map is such that calling an arbitary routine in another rom is awkward to say the least.. – Peter Green May 13 '16 at 20:10
  • @PeterGreen, it was not that hard, you just needed to put a few words of machine code in RAM, and call that from your ROM to swap to a different ROM. – Ian Ringrose May 16 '16 at 11:09
  • @Thraka The CP/M that was very popular was for the 8080/Z80 which was incompatible with the IBM PC. One of the reasons that QDOS (which was what Microsoft bought and made into MS-DOS) was even written in the first place was because CP/M-86 wasn't available. It took Digital Research so long to get it out that MS-DOS ate its lunch. Additionally CP/M-86 was more expensive and could not run CP/M-80 programs out of the box (seen in hindsight a reasonally performing emulator would have been a good move) so it slowly died. The Concurent CP/M-86 was a fantastic system. – Thorbjørn Ravn Andersen Dec 16 '18 at 19:02
18

As it says in Wikipedia BASIC:

The introduction of the first microcomputers in the mid-1970s was the start of explosive growth for BASIC. It had the advantage that it was fairly well known to the young designers and computer hobbyists who took an interest in microcomputers.
... BASIC was one of the few languages that was both high-level enough to be usable by those without training and small enough to fit into the microcomputers of the day, making it the de facto standard programming language on early microcomputers.

In other words, it was easy to learn even for those with no programming experience, and the interpreter memory footprint was small, which was important due to the cost of memory.
(I don't exactly recall, but back in the 80s an 8k bit RAM chip in C64 cost several dollars.)

The use of an interpreter was also important from an ease of use point. While other existing languages were similar and not so difficult to learn (for example FORTRAN), they had to be compiled.

This means that instead of getting instant results (or errors), you had to write the code, compile it (hopefully no errors otherwise you had to change the code again and compile again), and then run it. If any errors, back to square one you go.

user3169
  • 283
  • 1
  • 2
  • 10
  • 2
    "the interpreter memory footprint was small, which was important due to the cost of memory" -- and available address space. Most of the computers that came with BASIC on their ROMs did so using 16KB ROM in a 64KB address space, leaving only 48KB usable RAM even before the screen buffer was taken out. Bank switching made machines more expensive, so the first few generations of machines (up to the ZX Spectrum, Commodore 16, etc) avoided it. Switching to a 32KB ROM would have left little space for RAM, so 16KB was about as much as you could realistically hope for. – Jules May 16 '16 at 17:02
14

A lot of great information has been given.

One more thing to consider is what the machines were like. Most had no decent non-volatile storage - no hard drives, many didn't have diskette drives either.

Even the original IBM-PC came with a cassette tape interface - they used a standard audio cassette recorder/player. Even when they had a diskette drive, the drive was often painfully slow. (Looking at you, Commodore 64.)

Having a programming language built in meant that you only needed to save/load the very small program, and it meant that every instance of a given computer (ie, C64, TRS-80 Model III, TI/99, etc) had the exact same language available on it.

This had value because computer magazines actually had programs printed in them, and the readers would laboriously type them in, debug the typos, and run them.

Walt
  • 241
  • 1
  • 2
  • 2
    The factor which crippled the I/O speed of personal computers other than the Apple ][ was that they were designed to be connected to television sets. The FCC rules when the Atari 800 and VIC-20 were introduced required devices that connected to television sets to have emissions levels far below what would be allowable today. The Apple ][ wasn't designed for such connection, and thus was able to use parallel interfaces in ways its competitors could not. – supercat May 12 '16 at 21:41
  • This is the real answer. There wasn't enough room to build in applications, and many consumers might spend $500 for a computer, but would balk at spending an additional $200 for a disk drive. So you had to give them something that would make the machine reasonably usable yet keep the price low, and also provide support for commercial software. BASIC was it. – TMN May 13 '16 at 12:56
  • @supercat apple ][ was also designed to connect to tv, everything was until EGA – Jasen May 14 '16 at 19:48
  • 3
    @Jasen: Apple ][ was designed to connect to composite-video monitors. While it would have been possible to use either a standalone RF modulator or a VCR to convert the composite video signal into an RF signal that could be displayed on a common television, I don't remember ever having seen one exhibited that way in a computer store, nor have I seen computer stores selling television connection kits. – supercat May 14 '16 at 19:55
  • I recall reading "television" mentioned in the graphics chapter of the apple ][ manual, wikipedia claims a built-in RF modulator – Jasen May 14 '16 at 20:02
  • http://www.applelogic.org/files/AIIREF.pdf page 17 – Jasen May 14 '16 at 20:09
  • @Jasen: It does use the word "television", but if you check page 9 you will notice it's designed for connection to a "closed-circuit video monitor", I'm not sure where the Wikipedia page got its information about TV sets. I recently saw a talk by Joe Decuir, one of the major designers of the Atari 2600 and Atari personal computers, and he said that FCC issues were a real problem in 1977. The reason the Atari 800 shuts off when the cartridge cover is opened is not to prevent damage, but rather to ensure that it can't cause TV interference when the Faraday cage isn't sealed. – supercat May 14 '16 at 21:39
  • @Jasen: The manual scan you linked describes the Apple as a "class B computing device"--a category which, based on Joe Decuir's description, seems to have come into existence after the Apple and Atari computers were already on the market, and which increased by an order of magnitude the amount of radiation TV-connected devices were allowed to emit. Apples were sold for years, so the unnumbered typewritten FCC notice was probably stuck into the manuals sold with later machines. – supercat May 14 '16 at 21:45
  • I recall an early Apple II ad that showed it connected to a color TV with an RF modulator, and I found a link: http://aaplinvestors.net/wp-content/themes/revolution-20/investorimages/1977AppleIISpread.jpg. My best friend at that time had one (his parents were loaded), and it used a color TV as a monitor; it was quite common – Carl Raymond May 16 '16 at 18:56
  • 1
    Young people probably can't imagine a computer with no storage device. I used my VIC-20 for a year or so before getting a tape drive, which was unbelievably slow. Tired of the program you wrote? Turn it off and on again! – doug65536 May 17 '16 at 18:44
13

Looking at other sources, it seems the BASIC for the C64 was burned into a D2364 ROM chip (8192 bytes). This 8k was mapped into the memory address region at 0xA000-0xBFFF.

This was typical of machines at the time: processors like the 6502 and Z80 could only address a 64k range (addresses 0 to 0xFFFF), and within that memory map, some would be RAM, some ROM, some would be empty space, and perhaps some would refer to I/O ports on chips mapped into the memory space.

In many cases the supplied RAM would be much less than 64k anyway (although this seems inconceivably small by modern standards), so if 8k of the mapped space was taken up a ROM, then this wouldn't necessarily cause any problem to the owner.

As to why BASIC was supplied with a lot of machines: firstly we should say BASICs, since the implementations were wildly incompatible in machines from different vendors, but they all shared some common characteristics that gave some familiarity: GOTO, GOSUB, IF, PRINT, INPUT and so on.

At the time machines had limited memory space, and a language was needed that could fit in a small ROM, and that had a low overhead in RAM when executing programs. It needed to be an interpreter (rather than a compiler) due to limited RAM and typically no secondary storage (hard disk, floppy disk etc) that provided a file system. Also, it needed to be a simple language so that people could succeed in some basic programming tasks. There weren't anything like as many languages to choose from back then, and BASIC emerged as a soft-of standard that became a selling-point and perhaps even a requirement.

TheMagicCow
  • 511
  • 2
  • 5
  • 1
    BASIC on the C64 also occupied something over 1K of ROM at 0xE003. Routines in the C64 ROM at 0xA000-0xBFFD are 8192 bytes below the corresponding routines in the VIC-20 ROM from 0xC000-0xDFFD, but routines in the C64 ROM starting at 0xE003 are three bytes higher than those in the VIC-20 ROM starting at 0xE000, since 0xDFFD is a 3-byte "JMP" instruction. – supercat May 12 '16 at 21:36
  • 1
    This is more an answer to "how" rather than "why". – TMN May 13 '16 at 12:52
13

Short answer: so you could actually DO something useful with the machine out of the box.

Considering when these machines arrived in the mid-to-late 1970's, they were not only expensive "hobby toys" but software was hard to come by and peripherals were costly. If you compare this to the Altair 8800, you paid a lot of money for a machine that when you plugged it in it really did nothing.

Though Microsoft BASIC had been popular because it was easier to use than machine language, I've read things over the years that suggested that people wanted to use BASIC because the learning curve was smaller and could fit in the small memory of these machines; MS wasn't quite creating the trend, but going along with it. Yes, they did port it to 808x/6502/etc. chips at the time, but note that the original Apple I and II shipped with Integer BASIC which was written by Woz, not Microsoft (and based on HP basic, not Dartmouth). Given the relative ease of BASIC, you could write your simple recipe or checking account balance program while the world waited for VisiCalc to appear in 1979.

bjb
  • 16,259
  • 46
  • 141
  • 2
    No. Microsoft created the trend. The first Microsoft Basic was targeted at the MITS Altair which predates the Apple 1. Paul Allen and Bill Gates didn't look at the Apple 1 and say "hey let's make a BASIC interpreter", it was more like the other way around (Steve Wozniak decided he needed a BASIC interpreter after looking at the Altair). – JeremyP Mar 07 '17 at 11:54
13

Because at the time a personal computer without BASIC was a total non-starter. A personal computer without BASIC would seem as silly then as a computer without a web browser would seem today.

We considered BASIC interpreters essential in the 1970's and early 1980's because the modern concept of the personal computer as a machine on which one runs ready-made application programs was only beginning to emerge. BASIC was invented in 1964. Microsoft BASIC was released in 1975. Wordstar was released in 1978, Visicalc in 1979, Wordperfect in 1979, Microsoft Word in 1983, Lotus 123 in 1983. If you were a user then, you might have heard of some of these programs, you might be able to get a copy of one of them, and it might run on your computer (but probably would not).

Making practical use of a computer without programming was still very much a new idea. BASIC was seen as a language which end users would use to solve problems. I learned it from the 1975 book "Making BASIC Work For You". It is all about how to solve business accounting and record-keeping problems. The examples are things which today would be done using spreadsheets and other office applications.

The computer buyer was also different. The average person did not think that he ever would or ever could operate a computer and so had no desire to own a home computer. They were bought by hobbyists who valiantly tried to show their friends that the machines had some practical value (which was hard since most tasks took two or three times as long on a computer) and by parents who realized that microcomputers, even if useless now, were the wave of the future and wanted their children to "learn programming". In both cases it was essential that the computer be programmable.

David42
  • 291
  • 1
  • 5
13

During the late 1970s and early 1980s, ROM was cheaper than RAM. The amount of useful work that can be accomplished with a BASIC program that occupies a certain amount of RAM will be often greater than the amount that could be accomplished with the same quantity of machine code, so a computer with 16K of ROM and 8K of RAM could be more useful than one with 2K of ROM and 16K of RAM, even though the latter computer would cost more.

Further, editing a BASIC program "in place" is much more efficient than trying to do likewise with a machine-language program. In-place editing of machine code is possible, but for the most part generating efficient machine code requires creating a text file and passing it through an assembler. This in turn generally entails a long slow process every time one wants to modify the code and test it again. By contrast, in-place editing of a BASIC program is easy, and for many kinds of programs cutting the edit-build-test cycle from five minutes to five seconds is a huge benefit which vastly outweighs the difference in execution speed.

The need for BASIC largely disappeared when RAM got cheap enough that platforms like Turbo Pascal could allow the editor, compiler, source code, executable, and data to all be kept in memory simultaneously. Basic's primary benefit was the ability to keep everything in RAM, and once such ability became available in a compiled language there was no longer a reason to tolerate the slowness or semantic limitations of interpreted BASIC.

supercat
  • 35,993
  • 3
  • 63
  • 159
9

In addition to the answers above, something to keep in mind is that there wasn't a ton of commercial software available at the time compared to today and computers were not yet things that everyone needed or even found useful for their jobs. It's not like today where you could buy a computer, load it with Office and other software, use it to do your job, maybe even run your business and turn it into a multimillion dollar operation, and never touch a line of code.

Meanwhile when I went to college in 1995 I had fellow freshmen who could barely get their PC turned on but they knew how to program in Pascal because the American school system at the time taught programming because they didn't know what else to do with these computer things everyone is buying, but they knew that it was going to be a "thing" in the future.

So one of the reasons a lot of these old toy computers came with BASIC built in was because, compared to today, they didn't do much else. And they also tended to not run the software from the previous generation or any other computers (if you think about it, Apple's never completely shaken this mindset - they have few qualms about breaking backwards compatibility for machines more than a few years old and they sell a computer that can't run the software from the competition's platforms). Notice how it wasn't until the DOS/Windows cycle started happening that backwards compatibility became a big thing and then sales of computer took off. There were other factors too, like price, but it inspired a lot of consumer confidence when you could be reasonably certain your stuff could come along for the ride.

Tom Kidd
  • 863
  • 1
  • 6
  • 8
6

In short, it was because computers in the early age such as Apple ][ didn't come with OS and the BASIC was the INTERFACE you control your computer. You could access (read/write) files in the cassette tape via BASIC command such as load/save. Later OSs were introduced with Floppy disk drive.

geminiwing
  • 61
  • 1
6

The CPU companies had contracts with the designers of BASIC (Bill Gates). For people designing computers it made sense to use the language they had already paid the license fee for (BASIC). BASIC was good because it was small and predictable, exactly the thing for a ROM chip of the day. Every computer needs start instructions, originally stored in ROM, at the lowest bootstrap addresses. Since peripheral storage was VERY expensive, and ROM was cheap, it made good sense to use BASIC, for basic programs. Also BASIC contained "load" and "save" commands, which could be used interactively by the user and the users permanent storage medium (tapes or drives). This meant BASIC machines were very flexible, especially before WIMP technology became affordable. Why was it memory addressed? Because that was the cheapest way to do it. Even simple chips cost a fortune, and were very sensitive to timing and current/heat issues. The less chips, the far less difficulty getting a working computer off the production line. Since early PC's and home computers were going for office desk and home desk market cost was a massive concern.

mist42nz
  • 61
  • 1
5

"Why was BASIC built into so many operating systems?"

Because it was the popular choice. It's not like the systems that didn't include BASIC didn't have a BASIC-alternative. Every operating system has functionality that is hard-coded into it (like the boot process) and parts that can be programmed by the user (like startup scripts and scheduled tasks). To execute code that isn't known at OS-compile-time you need some kind of system to parse and execute commands. When creating an OS you define a set of commands that the user can give, BASIC is nothing more that a pre-defined set of commands. It was so popular because it was easy to learn, functioned well in many different environments and catered to the needs of most computer users at the time (and still).

Think of Bash (or sh, it's predecessor), it basically fills the same role that BASIC did for a lot of systems. You wouldn't wonder why so many *nix systems include Bash into the OS, it's an integral part of it.

Kevin
  • 151
  • 4
4

BASIC was first used at Dartmouth College in 1964. It was the first readily available programming language on time-share systems (the predecessor of cloud computing). In 1975 Microsoft released a version of Basic for the first consumer level microcomputer, the MITS Altair 8800. Apple, Commodore, Tandy and then IBM PC (in 1981) followed suit with their microcomputers. By the time IBM released the PC, Apple had already acquired considerable marketshare in schools and thus acquired lots of young budding programmers who mostly only knew BASIC.

In its day, BASIC was as indispensable as a web browser is today.

CyberFonic
  • 141
  • 3
  • This, while a good answer, is for the wrong question. It does not explain why BASIC was built in; in the Altair 8800, for example, Micro-Soft's BASIC was software that you could load separately to the operating system. – wizzwizz4 May 12 '16 at 16:10
  • @wizzwizz4 To the extent that the Altair 8800 could even be said to have an operating system... – user May 12 '16 at 16:50
  • @MichaelKjörling Good point. You could call it a kernel though! – wizzwizz4 May 12 '16 at 17:46
  • 1
    @wizzwizz4|: ROM was cheaper than RAM. Loading a BASIC interpreter into RAM made the RAM it occupied unusable for other purposes. Adding a 4K or 8K ROM chip with BASIC in it could allow BASIC programs to have an extra 4K or 8K of RAM to play with, but was much cheaper than adding 4K or 8K of RAM. – supercat Oct 06 '16 at 14:51
  • @supercat While this is true, this answer does not give this information. It talks about the importance of BASIC, but doesn't say why it was built-in. – wizzwizz4 Oct 06 '16 at 15:49
  • 1
    @wizzwizz4: To justify building in BASIC, one would have had to establish two facts: BASIC is was important, and building it in is was the best way to make it available. Discussions of the history of BASIC help to establish its importance; while that would not in and of itself mandate that it be built in, it's an essentail prerequisite. As for the Altair not having it built in, I think that's probably because Altair wanted to let people start using its BASIC while it was still in development, and replacing a tape (punched paper or audio cassette) was cheaper than a replacing a ROM. – supercat Oct 06 '16 at 16:10
  • @wizzwizz4: BTW, I've actually used Altair BASIC on an Altair 680, loaded from paper tape. I was not impressed by its garbage-collection performance; the GC took more than a second when the program had about 70 live strings total. Still, paper tape is sorta cool. – supercat Oct 06 '16 at 16:13
  • @supercat Perhaps you could write a blog post about it! :-) – wizzwizz4 Oct 06 '16 at 16:24
4

Because early hobbyists were a bit more technical about their computers, and did not just want to run applications on them. Most were tinkerers. BASIC on those machines literally was the operating system. The user interfaced by issuing immediate-mode BASIC statements.

Plus, back then you could get books of programs to type in. Even sophisticated programs could be "poked" into memory from the BASIC interpreter, and then executed by using a BASIC SYS command referencing the starting address.

wizzwizz4
  • 18,543
  • 10
  • 78
  • 144
cpurick
  • 61
  • 1
3

Once upon a time, 16 kilobytes of DRAM was expensive. The original 8080 Altair came with up to 4 kbytes of memory on a single memory board.

The only programming languages (higher than ASM) that could fit in that small a memory were Tiny BASIC (Palo Alto Tiny BASIC, Altair BASIC (Gates and Allen) and Woz's Integer BASIC, et.al.) and Forth. The only alternatives were hand coding assembly language, or cross-compiling on a larger minicomputer. Basic was more well known and far more commercially viable than entering programs in binary via front panel switches. Later personal computers continued with what the market was familiar with (from the books and magazine articles at that time), and came with BASIC loaded into ROM.

So the answer is:

BASIC (with a very simple OS for I/O) came in ROM on many early personal computers because mass-produced masked ROM was cheaper than RAM, on a per byte basis. 64k address space was considered huge at the time, so dedicating a portion of it to ROM was not considered wasteful. And BASIC in ROM allowed the computer to be usable on power-up, instead of after loading software via paper-tape, cassette tape, or some other media.

hotpaw2
  • 8,183
  • 1
  • 19
  • 46
  • ... and when the Jupiter ACE tried using Forth instead of BASIC, it flopped hard. So even once you're within the realm of things that fit in small ROMs, BASIC is the smart market choice. Though that machine was probably also too late to market: it offered character-only graphics visually similar to a ZX80 or ZX81 and just 1kb memory for £20 more than a ZX81, but this was 1982 so by then for another £35 you could have the faster colour bitmapped ZX Spectrum with 16kb. So it fell between two stools, being neither a smart value choice nor looking particularly future-proof. – Tommy Oct 24 '17 at 16:22