Question: 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](http://sta.c64.org/cbm64mem.html), 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?

Answer: 
Nobody so far has said the magic words, which is **[Microsoft BASIC](https://en.wikipedia.org/wiki/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](https://en.wikipedia.org/wiki/CP/M), it ran on the [TRS-80](https://en.wikipedia.org/wiki/TRS-80#BASIC), and -- of course -- the [IBM PC](https://en.wikipedia.org/wiki/IBM_Personal_Computer). Apple's [AppleSoft BASIC](https://en.wikipedia.org/wiki/Applesoft_BASIC#Background), [Commodore BASIC](https://en.wikipedia.org/wiki/Commodore_BASIC) and [Amiga BASIC](https://en.wikipedia.org/wiki/AmigaBASIC) 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!
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.