Microsoft BASIC source

280 views
Skip to first unread message

a...@papnet.eu

unread,
Apr 3, 2025, 8:30:10 AMApr 3
to PiDP-10
Hi everyone,
Bill Gates published the source of the original Microsoft BASIC yesterday:

As is well known it was developed on TOPS-10 and indeed the assembly code looks very much like MACRO-10. Does anyone know if this is a special 8080 version of MACRO or if it's plain MACRO-10 with some clever tricks to generate 8080 code? The files do say "SEARCH MCS8080" at the top. And has the 8080 emulator survived?

It would be really cool to resurrect this development environment and run 8080 BASIC on the pdp-10 again :)

cheers, aap

Steven A. Falco

unread,
Apr 3, 2025, 9:17:25 AMApr 3
to pid...@googlegroups.com
In 1978 I was in my senior year at college - we had one of the original Altair 8080 machines, and I was writing a simple 2-user time-sharing system for it in assembler as a senior project.

We also had a copy of Microsoft Basic for that machine, and for fun I created a file on the original floppy disk that was the size of the whole floppy. Thus, I could see if there were any deleted files on the floppy.

Well, there sure were! I looked through the contents, and found the assembler source code to the basic interpreter! It was in several pieces, and I had to do a bit of work to come up with a complete version, but I managed, and got it working!

I was then able to integrate the basic interpreter into my time-sharing project; I had to separate all the code and data so I could make the code portion re-entrant. So I probably had the only Altair 8080 with a multi-user basic system. Sadly, I didn't keep a copy, so it is long gone, as I doubt the college kept it either.

Steve
> --
> You received this message because you are subscribed to the Google Groups "PiDP-10" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pidp-10+u...@googlegroups.com <mailto:pidp-10+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pidp-10/050a52a9-b405-4300-bb74-a3d225e5193bn%40googlegroups.com <https://groups.google.com/d/msgid/pidp-10/050a52a9-b405-4300-bb74-a3d225e5193bn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Eric Smith

unread,
Apr 3, 2025, 10:59:07 AMApr 3
to a...@papnet.eu, PiDP-10
On Thu, Apr 3, 2025, 06:30 a...@papnet.eu <a...@papnet.eu> wrote:
Does anyone know if this is a special 8080 version of MACRO or if it's plain MACRO-10 with some clever tricks to generate 8080 code? 

It's plain MACRO-10 with a custom set of macros. Back when macro assemblers on Big Computers were ubiquitous and powerful, that was a common technique, as it was much easier than writing a new assembler, or even hacking up an assembler.

Macro assemblers on microcomputers were never as powerful as those on big computers, and that is for the most part still the case today. If anything, most assemblers in use today are far less powerful than MACRO-10, or IBM Assembler F (let alone H).

If there is a surviving copy of the macros, or of the simulator, they doesn't seem to have ever been made public. It was standard practice to use an assembler option to suppress output of both macro definitions and expansions from program listings, except when trying to debug the macros themselves.

Chuck McManis

unread,
Apr 3, 2025, 9:00:16 PMApr 3
to Eric Smith, a...@papnet.eu, PiDP-10
My memory disagrees with Eric's here. Somewhere, likely on a 1600 DPI 9 track tape, I have a listing of Microsoft BASIC that was assembled using CROSS80. That was an assembler that was written in Fortran that ran on the DEC 10. When I joined Intel in 1984, the MCS80 Macro Assembler ran on ISIS in what were called "blue boxes" and it was written in Fortran, having been ported from running on a variety of mainframe/minicomputer OSes (PrimeOS, TOPS-10/20, Tenex, and VMS). I believe MITS owned a Data General NOVA at the time and ran the cross compiler on that. I recall that you could get CROSS80 from DECUS and I know I used it on USC's TENEX and TOPS-10/20 systems in the late 70's.

My recollection is that Intel "acquired" CROSS80, re-badged it to 'MACRO80' and sold it to people who were developing software for their chips.

The similarity between CROSS80 (and MACRO80) was, in my recollection, because the author wrote it on a DEC 10 and modeled it after MACRO10 (which was a pretty nice assembler). Gary Kildall who wrote ISIS at Intel and CP/M when he started Digital Research was most likely the maintainer/source of Intel's assembler. Intel had VMS systems at that time in the Systems Validation / MIPO Marketing group where I ended up working.

At Intel I had noted the similarity because having used CROSS80 at USC, I already knew the source code format and how macros worked.

I don't disagree that MACRO-10 was customizable and that was a thing, but I have a clear memory of reading the CROSS80 Fortran source.

--Chuck


--
You received this message because you are subscribed to the Google Groups "PiDP-10" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-10+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pidp-10/CAFrGgTSjoJa9naZBqr%3DTKH27udqDQDsiwfteUwNznLqMgWGKRw%40mail.gmail.com.

DR

unread,
Apr 3, 2025, 10:59:54 PMApr 3
to pid...@googlegroups.com
Just a tangential question:


When a business or University had some big iron running with multiple
attached  users, did the FORTRAN or other compilers and assembly
programs get bought once and could be used by all, or was there some
sort of limit so if  user A was doing something, B, C, etc couldn't
engage it until someone signed off?


Obviously if there were five or six -8s running on campus you couldn't
buy one version and install on all of them.

Any idea how much these software tools cost?  Was a FORTRAN  (77 was the
one we used) a $1000?, $5,000?  how much did the stuff cost?  I assume
that if you bought a -10 and installed the company knew it wouldn't run
without an OS and must have (hopefully) included it with your purchase?

Just curious Dale


terry-...@glaver.org

unread,
Apr 3, 2025, 11:59:23 PMApr 3
to PiDP-10
On Thursday, April 3, 2025 at 8:30:10 AM UTC-4 a...@papnet.eu wrote:
As is well known it was developed on TOPS-10 and indeed the assembly code looks very much like MACRO-10. Does anyone know if this is a special 8080 version of MACRO or if it's plain MACRO-10 with some clever tricks to generate 8080 code? The files do say "SEARCH MCS8080" at the top. And has the 8080 emulator survived?

 As I was involved in various part of this... It was a series of MACRO-10 macros, at least well into the GWBASIC era (which made it much easier to "port" to x86) - The Spectravideo 318/328's BASIC was pretty much GWBASIC but with Z-80 macros instead of x86 ones. The 328, with a 3.58MHz Z-80, outperformed the 4.77MHz 8088 in the IBM PC on most benchmarks.

There was a multi-user Z-80 BASIC, for some system (I forget which) that had a homebrew OS that was mostly a database engine.

When I was at Lifeboat Associates (there's a name from the past!) I asked Microsoft to send us the change lists for BASIC, BASCOM (the BASIC compiler), Fortran and (I think) COBOL. We published abstracts of those in the Lifeboat (printed) newsletter, to convince people to buy updated versions. Eventually Microsoft noticed and told us to stop doing that. Side note - I was one of the first people to ask about a software update service - for a reasonable annual fee, users would get any new version(s) of their software shipped to them. Microsoft declined. I then said "At least give people a credit if they purchased the (now-obsolete) version in the last N months". I won on that one, because whenever we got a credit card charge reversal (and the accompanying fees), we deducted that from our Microsoft royalty payments.

Also at Lifeboat, I was there when Peter Roizen showed up to demonstrate what would eventually become T/Maker. IIRC, he was your typical disheveled computer type (that tended to have a Sol-20 and a Teletype in their living room). His sister Heidi struck me as the bright one of the two (or at least with a more practical worldview).

Back to Microsoft:

Then there were the deals with Soft Warehouse (in Hawaii, I think) and ASCII Corp. (a really bad pun at the time was "We have a 32K Nishi").

When the Spectravideo hardware was slightly tweaked and announced as MSX, I asked "Isn't that the name for a disease oysters get?" I was definitely *THAT* person in the room all the time back then.

Lars Brinkhoff

unread,
Apr 4, 2025, 1:21:59 AMApr 4
to PiDP-10
 As I was involved in various part of this... It was a series of MACRO-10 macros, at least well into the GWBASIC era (which made it much easier to "port" to x86)

I believe someone claims to have a copy of those MCS8080 macros.  But I'm not sure; I haven't seen it myself.

How do we reconcile this with Chuck's comments about CROSS80?  I guess Microsoft could have ported BASIC over from MACRO-10 to CROSS80?  Could they have had two versions in parallel, or one that worked on both?

terry-...@glaver.org

unread,
Apr 4, 2025, 5:28:47 AMApr 4
to PiDP-10
OEM customers who paid for a source license / license to modify / redistribute (like the company with the 4-user machine based on a database engine that added database commands to BASIC) got something that would assemble natively on an 8080, or any cross-assembler that could take standard Intel 8080 instruction mnemonics. I don't recall how Microsoft generated that - I think they just defined the configuration constants up front as usual but only exported the comments and code that was conditionally included.

The last "pure 8080 assembler " version I had the source on 8" diskette for (4.51) had all of the relevant comments, including the stuff at the top about being written on the PDP-10 and crediting Monte for the math code, still in there. By the time of the Spectravideo version, all we got was four or so numbered-copy giant printout binders, each with the PDP-10 listings of the Spectravideo version - as I recall, there were no references that I saw to the IBM PC in there - they'd been conditionalized out and didn't appear in the listings (though I certainly didn't read every page). My only interaction with the listings was making sure that the ROM BASIC could be accessed from CP/M (I did the SV CP/M implementation). Fortunately the SV engineer ("Steve" Ting) responsible for spec-ing SV BASIC insisted on hooks for everything including the kitchen sink in SV BASIC, so I could (for example) hook the load/save stuff that the ROM BASIC used to load/save from audio cassette and do CP/M disk load/save instead.

The member of the "Micro-Soft Gang of 13" I interacted with most was Steve Wood, and he had some great stories to tell.

Lars Brinkhoff

unread,
Apr 4, 2025, 5:50:59 AMApr 4
to terry-...@glaver.org, PiDP-10
The member of the "Micro-Soft Gang of 13" I interacted with most was Steve Wood, and he had some great stories to tell.

I worked for a while with Jim Lane at a Redmond-based company.  Much smaller than Microsoft, though Jim had been of their first hires in the distant past.  I think he may have been a gang member.

Stephen Jones

unread,
Apr 4, 2025, 6:15:19 AMApr 4
to Lars Brinkhoff, terry-...@glaver.org, PiDP-10
There were several sims written in macro10 on the KA at Harvard and Albuquerque School District.  The 6800 sim that came later was written by Marc MacDonald using the same method as for the 4004, 8008, 8080 and 6502.  That 6800 sim was recently sold as a listing in a Christie’s auction.

On Fri, Apr 4, 2025 at 6:50 PM Lars Brinkhoff <lars.br...@gmail.com> wrote:
The member of the "Micro-Soft Gang of 13" I interacted with most was Steve Wood, and he had some great stories to tell.

I worked for a while with Jim Lane at a Redmond-based company.  Much smaller than Microsoft, though Jim had been of their first hires in the distant past.  I think he may have been a gang member.

--
You received this message because you are subscribed to the Google Groups "PiDP-10" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-10+u...@googlegroups.com.

terry-...@glaver.org

unread,
Apr 4, 2025, 7:09:27 AMApr 4
to PiDP-10

Yup, Jim was one of the original Gang.

Stephen Jones

unread,
Apr 4, 2025, 8:54:18 AMApr 4
to PiDP-10
Courtesy of PDPplanet / SDF Vintage Systems.

 *
 * Visit https://wiki.sdf.org for documentation.
 *
 * Guest access is available:
 *
 * LOGIN NOACCOUNT (password is 'unguessablewords')
 * LOGOUT using 'KJOB' and CTRL-] quit
 *
 * CTRL-] quit to return to the menu
 *
PDPplanet DECsystem-10 05:36:23 TTY4 system 1025
Connected to Node KLAD10(66) Line # 4
Please LOGIN

.login [30,104]
Job 12  PDPplanet DECsystem-10  TTY4
Password:
[LGNLAS Last access to [30,104] succeeded on 23-Mar-125:04:12:16]
05:36    4-Apr-125   Friday

.run sim80

* SIM-8080 EXECUTION *

MEMORY SIZE? 8192

STRING SPACE?

WANT SIN-COS-TAN-ATN? YES


2100 BYTES FREE

ALTAIR BASIC VERSION 1.1
[EIGHT-K VERSION]

OK
PRINT 2+2

 4

OK
^C

.DAYTIME
Friday 4-Apr-125 5:37:00

.VERSION
SIM80 34(70)

DR

unread,
Apr 4, 2025, 3:49:25 PMApr 4
to pid...@googlegroups.com
While we are talking the genesis of languages and machines to run them
on, may I be allowed to ask this question:


What is Linux written in?  Assembler (seems like a lot of work).

What about the biggie compilers like C and C++?

Just curious.


Steven Hirsch

unread,
Apr 4, 2025, 3:54:38 PMApr 4
to PiDP-10
Linux is mostly C with some bits of machine-specific assembler where absolutely required.

Steven A. Falco

unread,
Apr 4, 2025, 5:08:23 PMApr 4
to pid...@googlegroups.com
Regarding the compilers, there is a bit of everything. The gcc tarball also contains some library source, and that is a real mixed bag. I've found C, C++, assembler, go, Fortran, ada, and so on.

There is a public mirror repo on github if you want to poke around:

https://github.com/gcc-mirror/gcc

The clang compiler is probably similar but I haven't hunted around in that one.

Steve
> --
> You received this message because you are subscribed to the Google Groups "PiDP-10" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pidp-10+u...@googlegroups.com <mailto:pidp-10+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pidp-10/acd27281-b0d6-41f4-b115-fefdca604579n%40googlegroups.com <https://groups.google.com/d/msgid/pidp-10/acd27281-b0d6-41f4-b115-fefdca604579n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Malcolm Ray

unread,
Apr 4, 2025, 6:13:37 PMApr 4
to Steven A. Falco, pid...@googlegroups.com
Mention of compilers is my excuse to recommend Ken Thompson's famous
Turing Award lecture "Reflections on Trusting Trust", available here:

https://archive.org/details/reflections-on-trusting-trust

I'm sure many people on this list are familiar with it, but hopefully
it will be a treat for anyone who hasn't read it before.

Andy

unread,
Apr 4, 2025, 7:29:09 PMApr 4
to PiDP-10
hey so I had a little wander. Unfortunately for me I am temporarily silly (I had a stroke) but can you explain this to me?

cheers! Andy

Figure 2.1 is an idealization of the code in the C
compiler that interprets the character escape sequence.
This is an amazing piece of code. It “knows” in a com-
pletely portable way what character code is compiled
for a new line in any character set. The act of knowing
then allows it to recompile itself, thus perpetuating the
knowledge.
Suppose we wish to alter the C compiler to include
the sequence "\v" to represent the vertical tab charac-
ter. The extension to Figure 2.1 is obvious and is pre-
sented in Figure 2.2. We then recompile the C com-
piler, but we get a diagnostic. Obviously, since the bi-
nary version of the compiler does not know about "\v,"
the source is not legal C. We must “train” the compiler.
After it “knows” what “ \v” means, then our new
change will become legal C. We look up on an ASCII
chart that a vertical tab is decimal 11. We alter our
source to look like Figure 2.3. Now the old compiler
accepts the new source. We install the resulting binary
as the new official C compiler and now we can write
the portable version the way we had it in Figure 2.2.
This is a deep concept. It is as close to a “learning”
program as I have seen.

DR

unread,
Apr 4, 2025, 8:01:28 PMApr 4
to pid...@googlegroups.com
Thanks to all who've replied.  Always something to learn.  For those who
just know it from living it, thanks for sharing.  Dale

terry-...@glaver.org

unread,
Apr 4, 2025, 11:34:30 PMApr 4
to PiDP-10
On Friday, April 4, 2025 at 6:13:37 PM UTC-4 Sheepless wrote:
Mention of compilers is my excuse to recommend Ken Thompson's famous
Turing Award lecture "Reflections on Trusting Trust", available here:

https://archive.org/details/reflections-on-trusting-trust

Speaking of things that rhyme with trust, a bit of Rust is now in Linux.

Since we've wandered well off into a discussion of languages in general...VAX/VMS evolved to having VAX-native code utilities instead of running RSX versions of the utilities in PDP-11 emulation mode (this was completed for the VMS V4.0 timeframe, except for TECO), when developers wrote the native utilities in their favorite language and linked them against the language run-time library which was distributed with each VMS release. That was their way of guaranteeing that "their" language would always continue to be supported under VMS. Bliss-32 was the most common language (it was pretty much the VMS implementation language, except for the low-level parts that needed to be in Macro-32). But there's a fair amount of other languages that make up the core utilities - PL/I and BASIC were two.

The program that generated the microfiche listings for VMS (back then, everybody got listings with their distribution tapes or disks) was written in Fortran and used an I3 format for the page number when generating the index sheets. VMS 5 (when listings became extra-cost for new customers but continued to be included for existing customers) went well over 1000 sheets, so much of the index was useless as it just had "***" for the sheet number.

Someone who probably wishes to remain anonymous, but had his phone number listed under the name "C F Patagonian" (CF stood for Cat Food) was the first (and possibly only) person to ever notice this. He represented one of those Large Government Customers With No Name and raised a stink about this - enough that DEC agreed to re-master all the VMS listing fiche kits from V5.0 to (IIRC) V5.3. DEC had to dig out the archived build packs for those VMS versions, find the exact same versions of the compilers, and do new VMS builds to get the listings to feed to the (fixed) index generator. That also involved doing binary compares of everything on the original VMS distribution to the re-built one, finding and fixing any differences (usually an un-recorded compiler patch) until identical output was achieved.

He asked a few close friends / co-conspirators if they wanted updated listing sets and I said "sure". Eventually this very large, very heavy box arrived with new microfiche.

Malcolm Ray

unread,
Apr 5, 2025, 1:58:29 PMApr 5
to Andy, PiDP-10
I started writing an explanation, but it turned into a more verbose version of what Ken Thompson wrote.
I suspect this would just make things worse for you! What part are you struggling with?
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-10+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pidp-10/a3554208-a5c7-4641-aca6-a1c0d7327e7en%40googlegroups.com.

Andy

unread,
Apr 5, 2025, 4:34:52 PMApr 5
to PiDP-10
Hey so this instance - how on earth is it actually learning about \v?

    It “knows” in a com-pletely portable way what character code is compiled

    for a new line in any character set.
    .....
     This is a deep concept. It is as close to a “learning”
     program as I have seen



Malcolm Ray

unread,
Apr 5, 2025, 7:28:59 PMApr 5
to Andy, PiDP-10
At the start of the exercise, the compiler doesn't "know" how to compile code containing that escape sequence.
At the end of the exercise, it can correctly compile such code, even though the encoding appears nowhere in the compiler source.
This required an intermediate step, where the encoding was made explicit. But that "knowledge" persists, even after that change is reverted.
It certainly feels like the binary has, in a sense, permanently "learned" something which is not present in its source code.

You can read much more about Thompson's trick here:


This includes the opportunity to actually try applying the original backdoor for yourself. Warning: it contains gotos!
Reply all
Reply to author
Forward
0 new messages