The Register Home Page

back to article Microsoft open-sources the 6502 BASIC coded by Bill Gates himself

Microsoft has open-sourced the version of BASIC it created in 1976 for the MOS 6502 processor used in many early microcomputers. As the software colossus explained in a Wednesday post, Microsoft founders Bill Gates and Paul Allen wrote the company’s first product, BASIC for the Altair 8800 microcomputer and the Intel 8080 …

  1. Neil Barnes Silver badge

    Does it mention...

    Gates' famous 'open letter' from 1976, complaining about people ripping off his basic for the 8080?

    1. Sandtitz Silver badge

      Re: Does it mention...

      No mention of it.

      Do you disagree with the letter?

      1. jake Silver badge

        Re: Does it mention...

        Do I disagree with it? Yes, at the time I did[0]. Almost everybody in the industry laughed at that letter. And promptly ignored it.

        Remember, at that time virtually every program came with the source code. If it didn't, you could get it. The way the law was written (at least here in the US), binaries weren't copywriteable, so code had to ship with source. It wasn't until 1983 that Apple managed to change that (see Apple v. Franklin.), thus bringing the landsharks into the world of software.

        Apple, Inc ... Stifling innovation, since 1983.

        [0] I probably still do, but I haven't read it since '76 ... my view on the subject has undoubtedly changed since then, but probably not enough to make a difference.

        1. Sandtitz Silver badge
          WTF?

          Re: Does it mention...

          So you think that all software is fair game to copy and use for free, regardless of the time and money put into it by the programmers or the company behind it?

          1. gnasher729

            Re: Does it mention...

            At the time Germany had laws that said there is no copyright, but copying work for free that a competitor created at huge cost is “unfair competition” which is illegal. That wasnt just software, but also things like phonebooks, dictionaries and so on.

            So it was explicitly _not_ fair to just copy. As long as you copied from a competitor.

          2. GNU Enjoyer
            Angel

            Re: Does it mention...

            If you have a copy of any software, you should have the freedom to make copies of it - it is ridiculous to restrict invocations of the cp command.

            Although that is only one of the 4 essential freedoms; https://www.gnu.org/philosophy/free-sw.en.html#four-freedoms

            If time and money was "put into" some software and profit is wanted, then clearly such company shouldn't provide a copy unless their wanted payment is made (although selling copies of software is mostly redundant now - as anyone with a computer can copy software - nowadays in 99% of cases, the money is in support or warranty).

        2. heyrick Silver badge

          Re: Does it mention...

          Funny. I never got sources to the BBC MOS nor it's BASIC. What I got were two ROMs in a machine stuffed with chips (the Oric looked positively barren in comparison). Didn't get the sources to EDWORD2 either, or... You get the point. On this side of the often, in the home computer boom, source code was a little known thing. I'd wager that most people wouldn't know what to do with it, and many of the machines, as sold, wouldn't be able to build their own firmware. So we got ROMs and EPROMs and cassette tapes and stuff that just worked.

          1. This post has been deleted by its author

            1. David 132 Silver badge
              Happy

              Re: Does it mention...

              So true. The number of times I plucked up courage to go into the newsagent for a copy of Sinclair User but lost my bottle at the last minute under the withering and judgemental stares of the staff and customers, having to scuttle out instead with a far more socially-acceptable copy of Goat Fetishist Weekly*...

              (*the only top-shelf mag to have a regular Kid's Section, of course)

              1. Anonymous Coward
                Anonymous Coward

                Re: Does it mention...

                Well played ... 'Kids Section' :=))

                :)

            2. Ropewash

              Re: Does it mention...

              There were more peeks and pokes to be seen in those than the ones further up the rack.

              1. Homo.Sapien.Floridanus

                Re: Does it mention...

                Upvoted you for that spritely pun.

                1. BartyFartsLast Silver badge

                  Re: Does it mention...

                  I wish I'd thought of it, but I'm not blitter

            3. Simon Harris Silver badge

              Re: Does it mention...

              Yes, I'm sure we all remember the Readers' WivesPrograms sections in the magazines of the day - pages of BASIC and assembly code, most likely with a few bugs added for good measure. But you never got to see the source code for the commercial stuff distributed as binaries or in the firmware.

        3. ThomH

          Re: Does it mention...

          In Apple v Franklin the court found that according to existing principles of copyright, it was infringement to copy ROMs if the code they contain amounts to the expression of an idea rather than the idea itself, in particular being interested in whether the code contained is the only way to achieve an idea or whether it's one that was selected from a range of possibilities.

          So, sticking with an example machine already raised, the composite colour ROM in an Oric — essentially a PCM sampling of the composite pattern that should be produced based on the TTL RGB colour — probably isn't copyrighted under that test. But the BASIC ROM is (modulo that it might itself be an unlicensed copy of Microsoft BASIC, though I'm not sure whether that's apocryphal).

          I'm honestly unclear on what basis you think that decision was flawed, or really anything other than inevitable. If you don't like the concept of copyright then fair enough, agree to disagree, but it's an odd case to focus your ire on.

          If someone's motivation were more anti-Apple then they should probably even celebrate it: between that ruling and the complete lack of any meaningful order or separation of concerns in Wozniak's coding it more or less strangled the Apple II clone industry in its cot and thereby cemented the IBM PC as the thing that grew into a commodity. IBM's lawyers were just as keen as Apple's but the PC BIOS has a clean and well-documented interface as far as it goes.

        4. Paul Hovnanian Silver badge
          Pirate

          Re: Does it mention...

          "Remember, at that time virtually every program came with the source code."

          I do. And I remember seeing the source for BASIC on the PDP-11 I used at the university. I wonder how wealthy I'd be now if I grabbed a copy and ported it to the 6502.

        5. Dan 55 Silver badge
          Stop

          Re: Does it mention...

          It wasn't until 1983 that Apple managed to change that (see Apple v. Franklin.), thus bringing the landsharks into the world of software.

          © 1982 Sinclair Research Ltd

          1. Strahd Ivarius Silver badge
            Angel

            Re: Does it mention...

            if it doesn't happen in the USA, did it really happen?

            1. Dan 55 Silver badge
              1. ThomH

                Re: Does it mention...

                Oh that I had kept a link... to the 1m+-views video that casually asserts as an aside that Mario 64 was the first 3d video game.

  2. BartyFartsLast Silver badge

    Well now.

    I know what I'm doing this weekend

    1. abend0c4 Silver badge

      Re: Well now.

      Unfortunately, the 6502 assembler I wrote many decades ago doesn't support macros or many of the storage directives in this particular assembler dialect.

      The online 6502 assemblers I've tried so far choked on the "TITLE" directive on the first line.

      So if during the course of your weekend you identify a compatible assembler, please let us know!

      1. m4r35n357 Silver badge

        Re: Well now.

        Assuming the OP was serious ;)

        1. BartyFartsLast Silver badge

          Re: Well now.

          I was.

          While I'm certain this is the first official MS release of the source into the public domain, this definitely isn't the first time the source has been put up on GitHub so I'm pretty sure there are ways to assemble it.

          Pagetable.com and a few other sites have covered the earlier release quite extensively

      2. Gene Cash Silver badge

        Re: Well now.

        Does GCC support 6502?

        Damn it, now I'm actually curious to try to cross-assemble this on Linux.

        1. Anonymous Coward
          Anonymous Coward

          Re: Well now.

          "Does GCC support 6502?"

          More importantly, does systemd?

        2. prandeamus

          Re: Well now.

          There are a number of compilers outside of GCC.

          - SDCC (Small Device C Compiler) is adding 6502 support,

          - the cc65 project has a pretty mature compiler, assembler and linker.

          - Most intriguing is the LLVM-MOS, is a fork of LLVM that includes support for a number of 6502 variants.

          On the face of it, 6502 is not well suited for C code generation. The lack of registers and the difficulty of implementing a recursive stack for auto variables means that code density is low compared to more modern machines. This is generally true of 8-bit microprocessors. Z80 had more registers on chip and was a little more C-friendly. The 6809 was the first 8bit machine with decent addressing modes and stack awareness to make idiomatic C code possible. And of course, the 64K address space limits what can be done easily.

          Microsoft's early BASICs were based around 8080, and they struggled with code density even when hand coding assembly. In terms of speed, there's not a ton of difference in the end products (all things being comparable), but You can squeeze more code into 8K using an 8080 compared to 6502.

          Do check out the CC65 and LLVM-MOS projects if you are curious about compilers.

          1. Tridac

            Re: Well now.

            Spent a lot of time on 6502 assembler for embedded work, and the indirect via page zero addressng modes were very powerful, if you knew how to use them. Even shelled out on the Manx C compiler, but the code density was dire. No worse than Keil C for the 8051 series, which produced pages of code for just hello world. Only so much that can be done with an 8 bit architecture.

            1. Nick Ryan

              Re: Well now.

              Page 0 was where all the real fun was to be had; it's where all the cool kids hung out. :)

              For those that have no clue what this is all about, which is probably most people, the 6502 accessed memory in 256 byte pages. This was efficient enough except when accessing data over a page boundary at which point this added additional instruction cycles to the execution time and when timing was critical this could be really important to take into account.

              Page 0 was a special case and was the first 256 bytes of RAM on the system and the CPU started at byte 0 in page 0 when booting. More usefully there were special instructions that only worked with page 0. These instructions were either faster than equivalent instructions elsewhere or required less bytes to store, and frequently both. It may not seem much but when an instructions takes, for example, 5 clock cycles elsewhere but 4 clock cycles in page 0 that's a significant speed increase.

              1. 8BitGuru

                Re: Well now.

                Close, but not entirely correct.

                First, the CPU does not begin execution at address $0000 at startup. The RESET circuitry places the hardware reset vector address $FFFC on to the address bus, loads PC (the program counter) with the 16-bit address stored in the two consecutive bytes there, and then starts executing instructions from that address.

                Secondly, there are no special Zero Page instructions. The 6502 addressing mode choices include Zero Page, and a subset of the instruction set supports that mode. The 'special sauce' of ZP addressing is a hardware shortcut in the instruction decode logic which reads one instead of two bytes as the instruction address operand, sets the target address lo-byte to the operand value, and forces the address hi-byte to zero. This saves a clock cycle during instruction decode as the address hi-byte does not have to be fetched, thus making read/modify/write operations in page 0 quicker than anywhere else in memory - and variations of ZP mode which offer indirection make for very fast jump tables or array processing logic.

                1. Simon Harris Silver badge

                  Re: Well now.

                  Apart from being a bit faster than absolute addressing (i.e. anywhere in the 64K memory map), the real special sauce of zero page on the original 6502 are the indirect indexed and indexed indirect modes, and later on the 65C02, the purely indirect modes. By which I mean instructions such as

                  LDA* (nn),Y: Read the contents of zero page nn and nn+1 as an address, add Y, and then read the contents of the 16 bit address thus created.

                  LDA (nn,X) : Read an address from (nn+X, nn+X+1) and then use that as a pointer to read from the 64K address space.

                  LDA (nn) - (65C02 only). Read the contents of zero page addresses (nn, nn+1) and use that as a pointer to read from the 64K address space.

                  * LDA as an example, but STA, ADC, SBC, ORA, EOR, AND, etc. too.

                  This zero page magic was necessary as the two index registers were only 8-bits, which on its own would be overly restrictive, but it emulated in the case of (nn),Y or (nn) potentially a lot more 16 bit index registers, or in the case of (nn,X) tables of indices. Essentially 6502 programmers would treat zero page, not just as standard memory, but as a register bank.

                  1. Dan 55 Silver badge

                    Re: Well now.

                    You could tell which code was ported from the 6502 to the Z80, it was full of LD A, (IY+n) which worked but was a bit costly.

                  2. prandeamus

                    Re: Well now.

                    After some 50 years of this design, I want to put it on record that the (ZP),Y addressing mode was much more useful than (ZP,X). Also, so many design patterns require you to use the first mode for addressing data with fully dynamic pointers, and you tend to spend eternities setting Y to zero or 1 when moving 16-bit data around. Also the original instruction set could increment or decrement X, Y or a specified memory location +/- 1 but NOT THE ACCUMULATOR. Other things that we'd see as omissions today, like the lack of multiply instruction, are honest reflections of what could be done at low cost in that area of tech at the time.

                    Various later iterations fixed this by adding (ZP) addressing modes without Y, or adding INC A/DEC A opcodes. It's a clever device for the mid-70s, and it will be forever part of my career in IT, but those are reasons why the code density can't match 8080 or Z80 in the general case.

                    The 6809, a few years later, was so much nicer but for Motorola it was too little, too late and too costly, which was one reason they decided to leapfrog the 16-bit market and with the 68000 get a toe-hold on 32-bit computing.

                    1. Simon Harris Silver badge

                      Re: Well now.

                      Yes, almost always used (ZP),Y, hardly ever used (ZP,X).

                      A trick with (ZP),Y if you were using it to traverse chunks of memory was to set your indirect address at ZP, some address in zero page, to XX00 and keep the LS byte of the address in Y. Then at the end of an iteration you'd do an

                      INY

                      BNE skip

                      INC ZP+1

                      skip: - compare ZP+1, Y with your end condition.

                      because INY was 2 cycles, INC ZP was 5, and for your end condition CPY nn is always going to be faster than LDA ZP, CMP nn.

                      If you were lucky and knew in advance what the state of the carry flag was going to be from some previous comparison, shift or adc/sbc, ADC #0 (if you know C=1) or ADC #1 (if you know C=0) is only 1 byte longer than INCA would be in the 65C02, and takes the same number (2) cycles, similarly for SBC and DECA.

                      In my 8 bit days the 6502 was what I used most, along with a couple of projects on the 6809 and Z80. The 6809 was my favourite for programming.

                      I suspect having spent 7 years programming 6502s before I programmed a Z80, my Z80 code was horribly unoptimised for that CPU.

                      1. prandeamus

                        Re: Well now.

                        The XX00 and Y solution is very neat. I wish I had thought of that one.

      3. An_Old_Dog Silver badge

        Compatible Assembler

        I'd suggest running a PDP-10 emulator. I use "PanelSim" on my Linux laptop. It includes Incompatible Timesharing System, TOPS-10, software for both, and a GUI front panel emulator which you can mouseclick-activate the buttons and knobs. (PanelSim uses SimH as a backend.)

      4. Dan 55 Silver badge

        Re: Well now.

        This version requires CC65 to compile.

        1. abend0c4 Silver badge

          Re: Well now.

          Thanks! Now I know what I'm doing this weekend!

      5. el_oscuro

        Re: Well now.

        Funny you should mention that. Because I wrote a 6502 assembler in Commodore BASIC. Back then, I was a broke teenager and couldn't afford the $35 for the macro assembler so I did the next thing and wrote it myself. The C-64 didn't have any kind of text editor so I wrote a simple EDLIN style one, also in BASIC.

        The whole setup worked pretty well. Best $35 I didn't spend.

        1. Phil the Geek

          Re: Well now.

          I wrote a 6502 disassembler in 6502 assembler on an Ohio Superboard. No reason, other than I could.

    2. OldGeezer
      Happy

      Re: Well now.

      Don't laugh too loudly - about a decade ago I got a job because of a 6502 assembler listing on the companies 'history' wall; they were impressed when I started at the beginning and explained what the program was doing. Nice that it was for a system I remembered from my mis-spent youth :)

      1. el_oscuro

        Re: Well now.

        I recently got an unsolicited job offer, WFH and six figures - for mainframe skills I haven't used in over 30 years. Turns out all of those ancient skills are still in demand.

  3. a_foley

    Obligatory Microsoft Cynic Comment

    I am sorry to say, but the cynic inside me tells me that this is Yet Another attempt from Microsoft to redeem itself within the FOSS community, so that they can continue with their perennial favourite of Embracing, Extending, and Extinguishing.

    1. werdsmith Silver badge

      Re: Obligatory Microsoft Cynic Comment

      And eating babies.

      1. This post has been deleted by its author

        1. steelpillow Silver badge

          Re: Obligatory Microsoft Cynic Comment

          Sir Percy got the low-down on him....

        2. Paul Crawford Silver badge

          Re: Obligatory Microsoft Cynic Comment

          Yes, his eminence added the "Bend over" instruction to be used before a particularly deep "poke".

  4. Anonymous Coward
    Anonymous Coward

    Shame everything else didn't subsequently receive the same courtesy accorded "VALTYP"

    3173 CHKVAL: BIT VALTYP ;WILL NOT F UP "VALTYP".

  5. Anonymous Coward
    Anonymous Coward

    "Microsoft later, ahem, drew inspiration from CP/M"

    Just like Torvalds & C. utterly copied Unix later?

    1. jake Silver badge

      Re: "Microsoft later, ahem, drew inspiration from CP/M"

      No. Microsoft never rewrote anything from scratch.

      1. Anonymous Coward
        Anonymous Coward

        Re: "Microsoft later, ahem, drew inspiration from CP/M"

        Proof, please. And I wonder how many Unix code was actually copied, since most developers had the source, while Microsft didn't have the CP/M source.

        This is also valid for the Java version Google uses in Android.

        Otherwise you'r just a MS hater just because you had to pay for its software or use illegal copies.

      2. ThomH

        Re: "Microsoft later, ahem, drew inspiration from CP/M"

        You mean never rewrote any part of DOS from scratch? I disagree.

        Microsoft rewrote the filing system interface and underlying implementation from scratch for DOS 2, modelling it on UNIX-style file streams in order opaquely to support directories, multiple users, network drives, and any other novel filing systems that might become relevant.

        This replaced the file-control block interface of CP/M and DOS 1, in which the storage for any given file's state has to fit within a fixed-size blob owned by the calling application. This was a substantial internal change relative to the limited total amount of functionality that DOS implements; it's less true to call it just a filing system dressed up as an OS than it is with CP/M but, well...

        There was also the abandoned multitasking DOS 4, a few years before Windows 3.x became the Microsoft thing that can multitask DOS applications. That made it out briefly, so the rewriting must have happened.

        1. Nick Ryan

          Re: "Microsoft later, ahem, drew inspiration from CP/M"

          Multitask... the only way to get a Microsoft OS prior to NT4, and in consumer OSes Windows 2000, to actually multi task was to use to multiple computers. Anything else was purely cooperative and any application or system function that wanted to use 100% CPU could and there was nothing much that the OS could do about it.

          1. Anonymous Coward
            Anonymous Coward

            Re: "Microsoft later, ahem, drew inspiration from CP/M"

            Wrong. Windows 95 was not cooperative multitasking. It lacked the process separation and security of NT, but it was pre-emptive multitasking - witn 32 bit apps.

            Anyway Mac OS wasn't pre-emptive until MacOS X (2001, six years after Win95), and it looked nobody complained...

          2. ThomH

            Re: "Microsoft later, ahem, drew inspiration from CP/M"

            Windows 95 used concurrent multitasking for all win32 apps.

            Windows 3.x used concurrent multitasking for DOS apps if you had a 386 or better.

            You're thinking of native Windows applications; these were cooperatively multitasked prior to Windows 95.

            But at least, unlike Mac OS, they were designed to be from day one. Prior to the MultiFinder Mac OS was explicitly single-tasking (desk accessories aside, which had specialised constraints).

            1. ThomH

              Re: "Microsoft later, ahem, drew inspiration from CP/M"

              *sigh* for the sad little anti-Microsoft troll, https://lunduke.locals.com/post/4037306/myth-windows-3-1-was-just-a-shell-on-top-of-dos is just one of many statements of reality available to anyone will the intellectual capacity honestly to enquire. Amongst other things:

              > Win386 ran individual "V8086" processes -- which was a key feature of the Intel 386 processor running in Protected Mode -- in a completely preemptive multitasking way.

              > This is key: All DOS applications ran as independent "V8086'' processes.

              > Which means that, if you were running DOS software under Windows 3.1... every single DOS application was preemptively multitasked.

              1. prandeamus

                Re: "Microsoft later, ahem, drew inspiration from CP/M"

                If I recall correctly, in Windows 95 each DOS box was pre-emptively multi tasked, using the 386 VM features although I suspect that quite a lot of the underlying code derived from MS-DOS wasn't reentrant and was protected by some locking mechanism, But yes, the DOS apps could run without modification and pre-empted.

                By the same token, the 16-bit & 32-bit windows apps were scheduled co-operatively? There were some subtle distinctions between the previous Windows/386 product which used a few 386 features to run DOS boxes and supported the 16-bit Windows API. There was a Win32S bodge to run limited 32-bit Windows apps, there was Windows 95 itself which supported native Win32 apps... I'm fairly sure , forgive an old man.

          3. Sandtitz Silver badge

            Re: "Microsoft later, ahem, drew inspiration from CP/M"

            "Multitask... the only way to get a Microsoft OS prior to NT4"

            ...was to get NT3.x ?

            "and in consumer OSes Windows 2000, to actually multi task was to use to multiple computers."

            That's just nonsense. People used multiple software concurrently since Windows 2.0 at least. You could even multitask in DOS. It just wasn't preemptive multitasking.

            1. herman Silver badge

              Re: "Microsoft later, ahem, drew inspiration from CP/M"

              I remember using a little utility called Double DOS, to run two programs on DOS - it was freaking amaaazing! Sigh…

              1. Jou (Mxyzptlk) Silver badge

                Re: "Microsoft later, ahem, drew inspiration from CP/M"

                dosshell could do that too... To a limited extend, but it worked.

          4. JoeCool Silver badge

            Re: "Microsoft later, ahem, drew inspiration from CP/M"

            Multitasking, without the Random J. Idiot proofing of premption, is still multitasking. Especially in embedded systems cooperative is the superior choice.

        2. Andy A
          Happy

          Re: "Microsoft later, ahem, drew inspiration from CP/M"

          I never saw the multitasking MSDOS 4 in the flesh, but did come across the documentation for it.

          A lot of the concepts described (and their naming) later appeared inside OS/2 and WinNT. It DID pre-emptive multitasking.

          Things get confusing to most folk because IBM's marketing department insisted on renaming DOS 3.4 as DOS 4.0.

          1. jake Silver badge

            Re: "Microsoft later, ahem, drew inspiration from CP/M"

            There were two different versions of DOS 4.X ... The first one, released in mid 1986 (my copy says May), was based on MS-DOS 2.x, but with multitasking built in. It was mostly a European release, but I saw it here in the US in a few places. Only a few OEMs shipped product with it installed (including ICL!), and I don't believe it was ever sold as a stand-alone product. It was widely ignored, with most folks gravitating to 1985's DOS 3.

            The second 4.x was the widely mocked IBM PC-DOS 4.00, released in July of '88, and the Microsoft bug fix release, MS-DOS 4.01, released in April of '89.

            Note that all versions of DOS from 2.0 (October '83) on came with the PRINT command. Background printing is technically a form of multitasking. See also so-called TSRs, and IBM's TopView from '85.

  6. m4r35n357 Silver badge

    And all Linus could come up with was the dominant OS on the internet!

    Oh, and also the dominant source control system. Still . . .

    1. Richard 12 Silver badge
      Coat

      Re: And all Linus could come up with was the dominant OS on the internet!

      Yeah, but open-sourcing Linux or git is olds, not news.

    2. Anonymous Coward
      Anonymous Coward

      Re: And all Linus could come up with was the dominant OS on the internet!

      The herd approach is very strong today. FaDD - Fashion Driven Development.

  7. jake Silver badge

    At that time ...

    ... I was hacking on the proto-BSD in C and assembler. When I read about MS-BASIC in one of the trade rags (probably computerworld ... infoworld came about a year or two later), I remember thinking "Oh, goody. Yet another dialect of BASIC. Just what the world needs ... ".

    I never did see a use for it.

    1. m4r35n357 Silver badge

      Re: At that time ...

      I think Mr Gates believed he was demonstrating mad programming skillz, hence the laughably arrogant "letter".

      https://en.wikipedia.org/wiki/An_Open_Letter_to_Hobbyists

      1. Lon24 Silver badge

        Re: At that time ...

        ....from that double barrelled company 'Micro-Soft'

        1. dmesg Bronze badge
          Joke

          Re: At that time ...

          Trying to out-perform it's competitor Macro-Hard.

          1. Wellyboot Silver badge
            Coat

            Re: At that time ...

            Still nowhere near as eloquent as Micro-Prose.

            It's the one with pilots wings.

        2. jdiebdhidbsusbvwbsidnsoskebid Silver badge

          Re: At that time ...

          "....from that double barrelled company 'Micro-Soft'"

          Not to be confused of course with "microsoft" (with a small m).

          https://www.zdnet.com/article/microsoft-everywhere-except-underwear/

          BLUF: The software company claimed people would be confused between their products and Asda's range of "microsoft" underwear.

    2. IvyKing

      Re: At that time ...

      "I was hacking on the proto-BSD in C and assembler."

      Which suggests you were at Cal ca 1976 and doing your dirty work in Evans Hall, or perhaps Corey Hall.

      The first comment I heard about the C language was that it was "an abomination in the eyes of the Lord" and a comment "If Bell Labs hadn't invented the transistor, the phone company would still be using vacuum tubes".

      FWIW, I got a BS degree and MS degree from Cal in '76 and '78 respectively.

      1. jake Silver badge

        Re: At that time ...

        I did most of my dirty work at home in Palo Alto, where it was quieter.

        Almost as soon as computers became more than somewhat useful to business, they were accessible from home. The Teletype Model 33 came out in 1963, and was in common(ish) use by top-tier remote mainframe support staff from home by the late 1960s. Dad had one installed in '67 or thereabouts ... the company even brought a second POTS line into our house for it, their dime. I soon used the same system to access ORVYL, the Stanford timeshare system, with the blessing of Dad's company. (I also later used it to access a new-fangled thingie that DARPA had Stanford and Berkeley et al working on ... but that's another story for another day.)

        1. IvyKing

          Re: At that time ...

          Thanks for the correction!

          I remember looking through the documentation for GE's timesharing service that was being used by the college where my dad was teaching circa 1969. My first exposure to computer programming was at the local CDC office a mile east or so of UCSD, and learned to like the IBM keypunches.

          Working from home is a little bit different when using a fiber optic internet connection with 20 million times the data rate used by the model 33, along with a key board that's easier to type on the the model 33.

  8. 0xF09F8687

    Never trust a Microsoft timestamp.

    Curious how .gitignore, README.md, and SECURITY.md are all dated "48 years ago"...

    1. Anonymous Coward
      Anonymous Coward

      Re: Never trust a Microsoft timestamp.

      Of course! Our Bill was ahead of his time in so, so many ways...

    2. richardcox13
      Boffin

      Re: Never trust a Microsoft timestamp.

      RTFM...

      git commit --date=1977-09-03

      1. bazza Silver badge

        Re: Never trust a Microsoft timestamp.

        I'm wondering what'd happen if someone tried to commit the source for Algol66 in such a way, with a 1960's timestamp. That'd be before the Unix epoch; something is bound to go wrong!

        1. Simon Harris Silver badge

          Re: Never trust a Microsoft timestamp.

          You can have Algol 60, or Algol 68.

          The 32 bit time stamp is a signed integer, so the beginning of 1968 would be represented by -63 million or thereabouts (although the first working implementation of Algol 68 wasn't until 1970 anyway), while 1960 would be around -315 million.

          Assuming its negativeness is honoured, 32-bit Unix time should be able to represent dates back to about 1902.

        2. richardcox13

          Re: Never trust a Microsoft timestamp.

          Create a local repo and give it a try...

  9. Ol'Peculier

    On another note, the school I went to had the CBM Pet that was the image in my feed reader for this article, the decals on the keyboard had all worn off so you needed to be able to touch type to use it.

    I was the only person that used it in all the time I was there...

    1. ITMA Silver badge
      Devil

      I bet you rubbed the key decals off yourself - deliberately. To ensure you were the only one to use it!

      LOL

  10. jake Silver badge
    Pint

    "glosses over how Microsoft later, ahem, drew inspiration from CP/M when creating MS-DOS"

    Seattle Computer Products' 86-DOS possibly infringed on Kildall's CP/M, but MS had nothing to do with that.

    According to Kildall, what happened was an artifact of the times.

    86-DOS wasn't a port of CP/M. It was a re-write that used the same API. Gary told me several years later that he didn't think it was a direct rip-off, just an unauthorized use of the published API. Back then, such use wasn't codified into law, wasn't illegal, and in fact it was completely normal. SCP was legally allowed to do what they did, and MS was legally allowed to purchase it and re-license it to a third party. Just as MS did later with AT&T Version 7 UNIX, which MS distributed as Xenix ... and everybody+dog did porting of BASIC to all and sundry.

    Trying to vilify somebody for actions back then based on today's law (or even worse, perceptions) just makes one look silly.

    RIP Gary, you cantankerous old fart. Thanks for the memories. Cheers.

    1. FIA Silver badge

      ... and bullied OEMs with Windows licenses designed to snuff IBM’s OS/2.

      Let's be fair here too, IBM didn't exactly do a lot to help itself. Pricing it higher than Windows didn't help adoption either.

      1. James Anderson

        OS/2. Great programming environment APIs etc. Horrible UI !

        1. JoeCool Silver badge

          3.o aka warp had an excellent ui

    2. Anonymous Coward
      Anonymous Coward

      "Trying to vilify somebody for actions back then based on today's law"

      Todays laws actually allow it - look at the Google vs. Oracle Java API case, and anyway not only MS did it with Xenix, but Linux/BSD did copy Unix as well, and court cases went into allowing Linux/BSD copy of Unix. WINE copies the Windows APIs. And others.

      There are many reasons to hate Microsoft (and Apple, Adobe, Google, Linux, etc. as well) but unless someone can prove MS lifted the CP/M code this is not one.

      Just some legends are hard to kill, especially in some haters' circles.

    3. Wellyboot Silver badge

      With all the different systems in use and the frequency of change within the 1970s computer industry anyone deciding on the 'not illegal' reuse of an existing API was doing almost as much benefit to the donor as themselves.

      Independent programmers would be more likely to choose a language that allowed for more sales due to a bigger range of compatible systems.

  11. Anonymous Coward
    Anonymous Coward

    Shenanigans!

    The "SECURITY.md" file is dated as last modified 48 years ago, too, yet it mentions github!

  12. J.G.Harston Silver badge

    I thouight this had been done ten years ago. Checking the datestamps on my download here says 08-Dec-2015.

  13. Will Godfrey Silver badge
    Black Helicopters

    Hmmm

    Many moons ago on one of the old newsgroups, someone was claiming Bill Gates didn't write 'his' BASIC but stole it.

    1. Tim99 Silver badge
      Windows

      Re: Hmmm

      It is a long time ago, and I may have "misremembered", but sometime in the late 1970s I thought that I heard that Gates and Allen had looked at DEC's RSTS-11 BASIC (possibly found by "searching waste-bins"?) before they wrote their Altair Basic interpreter. Obviously the architecture was different, but knowing how DEC's stuff worked would have been a big advantage...

      1. Antron Argaiv Silver badge
        Thumb Up

        Re: Hmmm

        I doubt you'd find the source code for RSTS-11 BASIC by dumpster diving, unless you were outside the DEC office where it was written.

        BASIC for the 16-bit PDP-11 will probably be much different from BASIC for an 8-bit processor.

        1. prandeamus

          Re: Hmmm

          MS Basic was influenced by the DEC Basic variants, for sure, in terms of the way string processing was done. But that's very different from saying the internals of both interpreters were the same.

          1. Wellyboot Silver badge

            Re: Hmmm

            The likelihood of them using DEC systems at Harvard was quite high, a diverse mix of hardware was (is?) normal for a University.

    2. Mage Silver badge
      Black Helicopters

      Re: claiming Bill Gates didn't write 'his' BASIC but stole it.

      He didn't exactly steal it. Paul Allen maybe did most of the original coding.

      Of course they didn't invent or develop BASIC. It was from Dartmouth College. A cut down alternative to ForTran. Beginners All-purpose Symbolic Instruction Code always sounded a bit forced.

      Allen & Gates did do the first 8080 BASIC, and basically that was the thing that made Microsoft successful enough to buy DOS and re-license to IBM. They capitalised on IBM's stupidity of using the 8088 instead of a real 16 bit CPU . It was easy to port CP/M and applications as the 8088/8086 could only address the 1 M RAM (max) in 64k chunks and is a very similar instruction set to the 8080. Intel even had a translator. I don't remember if it worked on binary or needed assembler, but 8080 binary created from Assembler can be turned into assembler fairly sanely even then.

      Brilliant marketing rather than great programming.

      1. This post has been deleted by its author

      2. ThomH

        Re: claiming Bill Gates didn't write 'his' BASIC but stole it.

        There are 1,000 things you could use to argue that the 68000 is the better processor, so for the sake of being devil's advocate I'll just point out:

        * the 8086's asynchronous bus unit does a better job at prefetching than the 68000's microcoded slots; the 8086 therefore does a better job of bus saturation; and

        * later, after the heyday of the ST and the Amiga and all the other 68000 excellence, the fact that x86 instructions have at most one indirect operand massively simplified the handling of exceptions. x86 instructions don't have to be restartable, they can all always just start again from the beginning if an exception was caught and handled the last time around. The 68ks jump through a lot more hoops here.

        Though obviously the ARM2 is the really smart way to spend about the same transistor budget as the 8086, albeit with an additional seven years of microcomputer hindsight. Spend the transistors on registers, hence make indirect accesses few and far between, hence use page-mode accesses almost all the time.

      3. sw guy

        Re: claiming Bill Gates didn't write 'his' BASIC but stole it.

        For what I saw of 8080 and 8086, do not expect binary compatibility.

        I have indeed heard of a translator by Intel, though I never encountered it.

        1. IvyKing

          Re: claiming Bill Gates didn't write 'his' BASIC but stole it.

          Intel stated that the 8086 instruction set was designed for source code compatibility with the 8080, which was source code compatible with the 8008. Seattle Computer Products had a program from translating Z-80 assembly code to 8086 assembly code, hence the hooks in 86-DOS to convert CP/M system calls to Int21H calls used in 86-DOS and subsequently MS-DOS.

        2. prandeamus

          Re: claiming Bill Gates didn't write 'his' BASIC but stole it.

          Have a look around for CONV86 and XLT86, which claim to be source translators.

          I didn't have occasion to use tools like this but Intel definitely sold one. Entirely possible it ran under ISIS-II, ISIS-III, or ISIS-IV, or even RMX86 on custom Intel hardware, as it pre-dates the IBM PC inspired commodity hardware. I spent a little time working for Intel in the mid-80s. From my addled memory, I don't think that using a third-party system like an IBM XT or AT to run Intel development tool software caught on until a few years later. YMMV. Anyway, if at that time when were shipping their dev tools to run against the UDI API interface on their own operating systems, changes of survival to the present day are lower. I wonder if they shipped early tools to run on CP/M? I don't remember that.

  14. Anonymous Coward
    Anonymous Coward

    With the benefit of hindsight...

    OF COURSE this was how it was done. It makes complete, absolute sense to do it this way. At the same time, it's like finding out Santa wasn't real!

    IFE REALIO,< DT"SIMULATED BASIC FOR THE 6502 V1.1">

    IFE REALIO-1,< DT"KIM BASIC V1.1">

    IFE REALIO-2,< DT"OSI 6502 BASIC VERSION 1.1">

    IFE REALIO-3,< DT"### COMMODORE BASIC ###"

    EXP ^O15

    EXP ^O15>

    IFE REALIO-4,<DT"APPLE BASIC V1.1">

    IFE REALIO-5,<DT"STM BASIC V1.1">

    IFN REALIO-3,<

    ACRLF

    DT"COPYRIGHT 1978 MICROSOFT"

    ACRLF>

  15. Jou (Mxyzptlk) Silver badge

    I like it!

    But didn't we already have it? I still have the "Commented ROM Listing" for C16/Plus 4 which taught me a few things, and some things were just plain weird. Same Book exists for C64.

    Missing: Basic 3.5 and 7.0 had Assembler/Disassembler builtin (C16/C116/Plus4/C128). Does the PET Commodore/MS basic 4.0 have Assembler Disassembler builtin?

  16. spold

    A little shortcut...

    In the Commodore PET version you could write program commands just using the first letter of them followed by Shift+Second letter.

    1. Jou (Mxyzptlk) Silver badge

      Re: A little shortcut...

      Basic 3.5 for C16/C116/plus4 could do the same.

      1. Chz

        Re: A little shortcut...

        Applied to the operating system's commands, as well.

        lO "$",8 was perfectly valid. (though unshifted "L" was a capital and shifted "O" was a weird graphic of some sort...)

  17. This post has been deleted by its author

  18. Antony Shepherd

    My first BASIC

    10K Microsoft Basic on the 6502 based Tangerine Microtan 65 was the first version of BASIC I ever coded in.

    Press 'A' at the 'Memory Size?' prompt and it displayed "Written by Weiland and Gates"

    Wasn't the first programming I ever did (the first being in 6502 machine code), but the first 'high level' language.

    Haven't written a single word of BASIC in decades now.

    1. Neil Barnes Silver badge

      Re: My first BASIC

      Rare to see mention of the Tangerine system these days; my second computer, after (no sniggering at the back there) a Sinclair MK14.

      It was selected after a careful analysis against a Z80 Nascom - the mail order for Tangerine accepted my credit card but Nascom didn't. Which is I suppose as good a way as any to start an interest in a subject that has kept going for fifty years... like you, it was hand-coded assembly to start, but eventually I shelled out for the 10k basic eproms. Which I promptly edited to use lower case keywords: the Tangerine could do upper _and_ lower case and I saw no reason to be shouted at by the code.

  19. Blackjack Silver badge

    So... Paul Gardner Allen didn't write it?

  20. BasicReality Bronze badge

    Now, someone should work on a re-write in Rust.

  21. Anonymous Coward
    Anonymous Coward

    BASIC coded by Bill Gates himself?

    Altair BASIC as inspired by a copy of a DECUS BASIC tape that Gates obtained from the DECUS User Group. Or was found in the cabinet of the school PDP computer. Which Gates, Allen and Davidoff used to develope Basic. According to Gates, in a letter to hobbyists, the computer time spent developing Altair BASIC exceeded $40,000. Gates was sanctioned for using unauthorized computer time, but the details of the terms were sealed.

    1. Antron Argaiv Silver badge
      Thumb Up

      Re: BASIC coded by Bill Gates himself?

      Way, WAY before Open Source, there was DECUS. And loads of freely redistributable application sources on ftp sites (with makefiles so you could compile them for your particular flavor of hardware and Unix)

      1. Jou (Mxyzptlk) Silver badge

        Re: BASIC coded by Bill Gates himself?

        You mean this DECUS, who had to shut down ftp on Jan 2025 due to way too many buggy, bogus or deliberately disruptive connections?

  22. vapoureal

    My business application

    MS Basic on an 8" floppy is what I used to build my first live business application running in 32K of ram on an 8080 on CP/M in the Welsh Valleys. And it worked for years. It changed my life completely, opened doors to working in places like Moscow, Kazakhstan, Middle East, even London. Carpe diem.

    1. hh121

      Re: My business application

      Ditto. Writing financial software in Basic for a little accounting firm north of London in the early 80s got me started, then off into military simulators, enterprise financials and MRP software, then off round the world - currently sitting on the other side of it.

  23. Grunchy Silver badge

    Floating point

    There’s one thing that always fascinated me and that was the floating point representation in binary, then the C interpretations of float, double, and long double. Quirks like sometimes 1+1=1.999999999999, and the 387/487 math coprocessors which could do those calculations in just a couple clocks.

    But the real majesty is doping out the floating point representation in BASIC, and how the operations worked. Sure, it’s all canned now in processor op-codes, the representations have been codified as IEEE standards, nobody even bothers learning how the nuts and bolts of it works. I credit Jim Butterfield for explaining the mechanics such that homemade machine language programs could benefit from floating point data and manipulation (back when M.L. was king for extracting performance).

    If you wanna do 3D transformations, floating point is necessary. If you wanna do fast code, well, once upon a time M.L. was necessary. Putting the two together, for a game like Elite, well you’d have to be extra-bright for something like that!

    1. 42656e4d203239
      Pint

      Re: Floating point

      >>Putting the two together, for a game like Elite, well you’d have to be extra-bright for something like that!

      Absolutely the best example of concise programming ever!!11!!!11!!! (hyperbole - don'tcha love it?)

      I remain in awe of Elite - the authors managed to get an open(ish) universe, deterministic, 3-D spaceflight game into 64k (or less? can't remember, it was a while ago) and it had a reasonably sophisticated profit protection system built in as well.

      Beer for all the old school coders who know what they did and what they were doing ---->

      1. John Brown (no body) Silver badge

        Re: Floating point

        "I remain in awe of Elite - the authors managed to get an open(ish) universe, deterministic, 3-D spaceflight game into 64k (or less? "

        Way less!! The BBC Micro had, at most, 32K RAM in a "standard configuration" and a fair chunk of that was used for video memory. That's not even large for on-die L1 cache these days. In fact if you add up all the registers in a multi-core CPU (or GPU), the registers alone probably exceed the space needed to run Elite :-)

    2. Dan 55 Silver badge

      Re: Floating point

      Also, BASICs like Sinclair's and MS BASIC versions compiled with 9-digit accuracy had better floating point representation than IEEE 4-byte floats.

      1. Simon Harris Silver badge

        Re: Floating point

        Quite a few BASICs of the time used 5 byte floating point (32 bit mantissa, 8 bit exponent) rather than the 4 bytes that became standard for floats. Those extra 8 bits gave you 2 and a bit more decimal places of precision.

  24. deadlockvictim

    Does it come with Copilot?

  25. Dizzy Dwarf

    Well, it's not BBC basic

    so, meh

  26. Fruit and Nutcase Silver badge
    Alert

    Bugs

    Any new discoveries, is Bill available to fix them?

  27. 8BitGuru

    CBM BASIC V2

    That's where the adventure started for me - first on a 4032 PET at school in 1980, then a VIC-20 when they arrived on our shores. 3583 BYTES FREE FTW!

    Still coding for that little breadbin in 6502 today.

  28. I Am Spartacus
    Childcatcher

    KIM-1 Thanks for the memory

    University, 1977, we were each given a KIM-1 as a set of parts. We had to solder the board together, then write a simple display program as our first assembler language class.

    I had mercifully forgotten the hours of keying hex code into the memory, hoping you hadn't made an error early on.

  29. John Brown (no body) Silver badge
    Thumb Up

    And not forgetting...

    ...that Commodore "shafted" Bill on the deal for BASIC too. They bought it outright rather than a per CPU licence[*] and went on to produce millions of computers, mostly for "free" in terms of the BASIC. IIRC, it's why most (all?) of the CBM 8-bit computers had no BASIC extensions for sound, graphics and disk handling and did so much with existing commands with added parameters or lots of arcane POKEs and PEEKs but had the side effect of BASIC programmes mostly being compatible between Commodore computers if you stuck to BASIC and didn't "bang the hardware".

    * Almost every other implementation of MS BASIC was done "on the cheap" by the manufactures because the per device royalty seemed cheaper in the short term but Commodore had big ambitions and offered what to Bill at the time seemed like a large one off payment for the rights. I think Bill went on record at some stage saying he regretted that. Even at $1 per device, he "lost" $millions on that deal ;-)

    1. Dan 55 Silver badge

      Re: And not forgetting...

      Commodore had the source and could have added new commands to their version of BASIC when they were developing the C64 but they were just too cheap to do that too.

  30. matjaggard

    I found a mistake

    I found a mistake on line 119 of the main assembly file.

    1. Anonymous Coward
      Anonymous Coward

      Re: I found a mistake

      Pull request #1?

  31. Teejay

    MS and C64 Basic vs BBC Basic

    All I remember is that both MS and C64 Basic were terrible in comparison to BBC Basic.

    BBC Basic was lightning fast, had recursive subroutines, graphics and sound commands, could directly talk with a serial interface, and could include assembler, simply by inserting it between brackets.

    1. Jou (Mxyzptlk) Silver badge

      Re: MS and C64 Basic vs BBC Basic

      C64 basic (2.0) was terrible compared to C16/C116/Plus4 basic 3.5 (which was AFTER VICE basic 4.0). Gosub recursive OK, graphics commands (albeit slow implementation), and sound commands. Reading serial interface, well, not from basic if I remember right :D.

  32. mcresearch

    Gates write code? I don't think so. He was good at appropriating but not coding. Jobs was similar; he leveraged others' talents.

  33. GNU Enjoyer
    FAIL

    No, microsoft did not "open source" 6502 BASIC

    The project has no license as LICENSE file dumped into the project root doesn't legally mean anything without a license statement stating which files are under which license (there is no way microsoft would not know this).

    Looking in README.md, there is a statement indicating that the m6502.asm file has no license - as it says copyright microsoft, without listing a license.

    - **Filename**: `m6502.asm`

    - **Copyright**: Microsoft Corporation, 1976-1978

    Also, in the m6502.asm file, there are 2 statements that make it clear that the file has no license;

    --------- ---- -- ---------

    COPYRIGHT 1976 BY MICROSOFT

    --------- ---- -- ---------

    "COPYRIGHT 1978 MICROSOFT"

    It isn't even source-available either - on line 2 there is a `SEARCH M6502` instruction that is looking for another source file that has not been provided.

    It seems that needed file is M6502.UNV; https://github.com/microsoft/BASIC-M6502/issues/9

    Attempting to read the source, it looks like typical microsoft quality code and many lines do not have comments (with assembly, unless you comment every single instruction, you won't recognize what you wrote coming back next week).

    Many of the comments seem extremely poor too;

    ;ONE MO TIME. - why one more time?

    ;ROTATE ARGUMENT 1 BIT RIGHT. - why is the argument being rotated 1 bit right?

    ;IS IT POSITIVE? - why are you checking if the value is positive?

    Yet another case where microsoft has ensured to never release free software - even if the software is totally useless.

    >the MIT License that allows free unrestricted use, and even resale.

    Many MIT licenses do not allow unrestricted use or resale.

    MIT expat may not allow freedom, as it does not cover trademarks or patents - either of which can be used to render software proprietary (even though such program is from 1978, it is extremely likely that one or more of the patents in microsoft's huge patent mountain applies).

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like