The original source code of Microsoft GW-BASIC from 1983
devblogs.microsoft.com
devblogs.microsoft.com
I'm now a researcher at an AI lab in Silicon Valley, and I just finished a five-week stint as a section leader for Stanford's CS106A "Code in Place" introductory Python course (https://www.stanforddaily.com/2020/05/07/students-instructor...). There's nothing like the joy of programming for the very first time, the realization that you can create something that works with code. Teaching those sections as well as finding my QBASIC book has reminded me of the feelings that I have from when I started learning how to program roughly 22 years ago. This release of GW-BASIC was quite timely for me.
I remember changes the variables in the gorilla banana toss game that came with qbasic ~ first time seeing changes in programming changing the game and it was magical.
My friend ended up being a great programmer and I'm doing e-commerce front end / project management work. Great times and I'm thankful for the experience
Now, some kids in college have an impression that coding is less relevant for a CS career.
Learning nothing but theory can come back to bite you some times.
After a chuckle, I showed them how to open the case and retrieve the CD.
In their capacity as a tool, computers will be but a ripple on the surface of our culture. In their capacity as intellectual challenge, they are without precedent in the cultural history of mankind.
(Turing award lecture, 1972)
As our second best DBA did when I worked at BT - he had worked at NPL and Dijkstra was his boss
Good times. The best was when there was a typo or a bug or it just didn’t work. Esp. the machine code that was just pages of hex.
And Cherry made peripherals/components, https://en.m.wikipedia.org/wiki/Cherry_(keyboards).
I guess such names make for simple logos.
Cherry, yes – good catch!
I'd forgotten about the cool little LCD display until I looked up your link to it.
Somehow I ended up trying QBASIC a couple of years later and programming suddenly became a lot easier and fun. I especially loved that you could easily switch to graphics mode and just start drawing pixels and lines to the screen, it was like the perfect blank canvas to try out different ideas for a curious young mind.
from turtle import *
color('red', 'yellow')
begin_fill()
while True:
forward(200)
left(170)
if abs(pos()) < 1:
break
end_fill()
done() #!/usr/bin/python
from pygame import *
pantalla = display.set_mode((0, 0), FULLSCREEN)
draw.rect(pantalla, 128, (50, 100, 200, 400))
display.flip()
time.delay(2000)
That's from https://github.com/kragen/pyconar-talk/blob/master/helloneg1.... There are some more examples in that directory. They use PyGame, though, which isn't installed by default like POINT.By default Python comes with Tkinter, though, which lets you do this:
from tkinter import * # or Tkinter in Python 2
w = Tk()
button(w, text="Not OK", command=w.destroy).pack()
That's a fuckload more than you can do graphically in GW-BASIC.For graphics, though, you're better off in JS and DHTML. In http://canonical.org/~kragen/sw/dev3/tweetfract.html I have an HTML canvas which renders a fractal if you click on it, in 140 bytes:
<canvas onclick="c=this.getContext('2d');
function d(x,y,k){c.fillRect(x,y,1,1);
(k/=2)>1&&(d(x,y,k),d(x,y+=k,k),d(x+k,y,k))
}d(0,0,150)">
Moreover, if you put that on the web, you can link anyone in the world to it, and they can run it just by clicking the link. And you don't have to start that complicated; this works too: <b onclick='this.style.color="red"'>DO NOT CLICK ME</b>
You don't even need a server; you can put that into the address bar of your browser as data:text/html,<b onclick='this.style.color="red"'>DO NOT CLICK ME</b>.LÖVE2D comes with a bunch of simple examples, like https://github.com/love2d-community/LOVE-Example-Browser/blo...:
-- Example: Loading an Image and displaying it
--[[Description:
Load an image using love.graphics.newImage(image_path)
Draw it using love.graphics.draw
]]
function love.load()
image = love.graphics.newImage("assets/love-ball.png")
end
function love.draw()
love.graphics.draw(image, 400, 300)
end
LÖVE is programmable in Lua, like Minetest and WoW, and it gives you rotatable, alpha-composited 2-D sprites with collision detection and particle systems.But Proce55ing is the paragon of this stuff. http://sketchpad.cc/, which uses processing.js, starts you off with this:
// Pressing Control-R will render this sketch.
int i = 0;
void setup() { // this is run once.
// set the background color
background(255);
// canvas size (Integers only, please.)
size(300, 300);
// smooth edges
smooth();
// limit the number of frames per second
frameRate(30);
// set the width of the line.
strokeWeight(12);
}
void draw() { // this is run repeatedly.
// set the color
stroke(random(50), random(255), random(255), 100);
// draw the line
line(i, 0, random(0, width), height);
// move over a pixel
if (i < width) {
i++;
} else {
i = 0;
}
}
That just fucking blows away anything I ever created in years of messing with GW-BASIC. And sketchpad.cc lets you edit your code in real time with someone else, and also save a link to the sketch you've made so that anyone else can see it. Still, I translated it to Python for my talk about this stuff at PyCon Ar (https://github.com/kragen/pyconar-talk/blob/master/hello1.py): #!/usr/bin/python
from pygame import *
from random import randrange
pantalla = display.set_mode((0, 0), FULLSCREEN)
ww, hh = pantalla.get_size()
color = Color(64, 64, 192)
for xx in range(0, ww, 5):
h, s, v, a = color.hsva
color.hsva = xx * 270 / ww, s, v, a # cambiar hue
draw.line(pantalla, # surface
color,
(xx, 20), # punto de inicio
(randrange(ww), hh - 20), # punto de terminar
10) # ancho de rayo
display.flip() # para mostrar
Maybe the biggest environment for this kind of thing nowadays is Roblox, which has a couple of million people writing games in Lua in a 3-D world. It's not free software, but neither was GW-BASIC at the time.Eat me, GW-BASIC.
Lots of begging parents later I owned the book, struggled through it and build some small things. The interesting thing is I never programmed that much but was always fascinated by what amazing things existed. I guess I mostly liked reading about technology and using it a bit. I then mostly went through a phase of playing games on the family computer, completely destroying it when I tried to install Suse-Linux from a CD from some magazine (I was still very young and didn't fully understand what an operating system even is but the article made it sound very cool). My next phase of interest was when I discovered the Llama book and O'Reilly books in general. Programmed some Perl, picked up some other languages but never really build anything worth noting. And then the last experimental phase was when I stumbled upon "Smashing the stack for fun and profit" and into the huge field of computer security. Went through a lot of "crack mes" etc. and just had a fun time. After that I started to understand how things worked a little more and went about it in a more structured way that eventually lead to a CS-ish degree. But I still have the fondest memories of the time when I basically knew nothing and was just fiddling around and then pooof sometimes cool stuff happened, sometimes stuff broke :P
So yeah tl;dr...if it wasn't for stumbling onto Basic some day I might have never gotten interested in anything related to computers.
My favorite program for autoexec just had an infinite loop until you hit Ctrl+C.
That night as I tried falling asleep, the numbers and functions were all I could think about, preventing me from sleeping. It scared me, but I knew that excitement would lead to something interesting someday. It did: I can trace my academic work and career directly back to that experience with the Precomputer 1000.
To this day, I try to limit my bedtime reading to fiction, because when I read technical non-fiction, I get too hopped up on knowledge to want to fall asleep.
It turns out, I was using N88-BASIC(86), developed by a Japanese team. Reverse-engineered from N88-BASIC to run on 8086 processor, and produced bytecodes compatible with Microsoft's GW-BASIC, which was released around the same time.
> There's nothing like the joy of programming for the very first time, the realization that you can create something that works with code.
That's so true. I'm thankful that I had use of a computer as a toy, essentially, and the joy I found in creative programming carried me far into the present. I'm not in the education field (at the moment) but would love to, as I get older, to do my part in passing down the torch, to inspire younger people to feel the magic. In my current role at a company, as part of the leadership, I also try to find, share, and encourage that joy.
The first time I had an idea of what programming was, was when I saw my brother trying to explain to me that the window had code that ran it. Of course, I ignored him...
We later did Delphi at school, which was maybe a crazy pedagogical decision. The only thing I would say pedagogically useful was that you wrote PUBLIC and PRIVATE for variables, but C or Java has that for functions.
One way in which I would say my fascination differed is this:
> the realization that you can create something that works with code
A lot of programmers mention the ability to write concrete instructions as their first realisation. OP is closer to my experience, but to me the a-ha moment was more surreal: It is strange to me, even today, how a computer can even exist at all. I often refer to that when I think the world is unstructured.
So, things like NAND gates (and fully homomorphic encryption) are almost mystical; more generally, I feel like computers are something of a vindication for mathematics that started in the Renaissance. Things can be mystical and mundane at the same time. There is a joke about this along the lines of a specific type of medical doctor, but I don't think I can post it here...
On the whole, I don't see a problem with doing Delphi (or Free Pascal + Lazarus) in school, especially if students have studied Pascal earlier - it teaches them many of the same concepts they'll later see in the likes of Java and C++, and it gives them powerful tools to create "real" GUI apps. There are better options these days, but it's not the worst one.
I think that Delphi could be a good language to teach in, but in practice it doesn't seem to be. You lose a lot of students along the way that feel it's irrelevant. In classes where you have a really good teacher they would add in "modules" of their own, irrespective of whether the syllabus makes sense or not. Often, however, a class barely gets through the standard workload to start off with.
Except I'd learned Speccy Basic from an Usborne book (Prior to getting access to a real computer) and as a result some parts of my programs failed to work correctly (usually stuff around PEEK and POKE)
It was a while before I worked out that the issue was :-)
We had a school 'computer room' which hosted ten BBC Micros. The mathematics teacher at the time ran an after school computer club and it was alleged that the last 30 minutes were unstructured and some students had managed to get a cassette tape copy of Elite (now Elite Dangerous) loaded onto some Micros. This absolutely blew my mind and I had to get in there somehow. The problem was I knew nothing about computers and I had no computer at home to practise on (this was also not likely to change as I was part of a financially stretched single parent family).
What I did manage to do however, was get a copy of Computer Weekly from WH Smiths. This particular edition was running a monthly section on 'Programming in Basic'. Now as said I had no computer, but I was not deterred into letting that stop me, so I wrote my first program on some A4 paper. As with many first time programmers, It was a text based adventure game with a multiple choice engine:
You find yourself facing the dragon. Do you?
A, Fight the dragon B, Run away C, Use the magic potion the elf gave you. D, Do nothing.
The program itself consisted of nothing more than print statements, capturing user input and then conditionals leading to "goto line X" statements. Quite soon this got hugely un-manageable and I realised this programming stuff was not as easy as I thought. Somehow though, I summoned the confidence to take it to the math teacher for his feedback and thought perhaps he might see some promise in me sufficient to get me into the club. He leafed through a few pages and said I could join. He later told me that he was more impressed that someone would attempt such an effort, more than myself showing any sort of genius.
Years later now, that snotty nosed inquisitive 11 year old is now a Principal Engineer with a long career spent building many, many systems with many engineers. I have always remained a software engineer , while colleagues have drifted off into management. I will be honest, I am still as excited about tech as I was when I was young upstart. I am also still all to willing to take risks, fail and bite off more that I can chew. In reflection that sense of false bravado is what has led to my career being as successful as it has been. It's never been about how beautiful my code is or how well I understand the deep idiomatic nature of whatever the new language is. It’s been my naive over confident nature to always take on more than I can handle.
Years later learning about the Z-machine was a revelation.
I'm glad that BBC BASIC offered a more structured version of the language, with named subroutines and all, since it allowed me to move fairly painlessly to my next language, Turbo Pascal on a PC, followed by Turbo C.
Tech isn't fun anymore...
Go small. Embedded / retro / various micro controllers are a ton of fun, and they have most of the feel we all experienced back then too. A decade ago, I had a bunker. Unix, Linux, Windows, BSD, OS X, all piled into a basement running pretty much everything. It was serious fun building it up, and then when I got there?
These dark times took a lot of the fun out of it. So, I literally gave the best away to a younger guy I could see drooling over the whole works and ordered some micros. Back to my roots.
Assembly language was fun in the 80's. It's fun now. Hooking shit up to do things? Yup. Even more fun now because there is so damn much just laying around, and we can get almost anything delivered for a song too.
Back in the day, I actually got good at vacuum tubes. That is what was laying around, and I was in poverty at the time. (Which actually was good for me personally, no worries, no regrets, no harm done)
My point being:
Seeing and channeling that excitement will pay off for most who experience it.
Yeah, big brother networked computing is in a dark time. Oh well. It's a big world of tech out there.
And, these days?
Hell, we are super good at electro mechanical. So, a young person can get a look at that, learn to program, control things.
Then, head over to bio tech, which will soon be electro-bio-mechanical, among other things, and likely experience a boom and sense of wonder at it all same as we did.
I pretty much am against snuffing out those little sparks. Sometimes there is only one. Sometimes they don't come back.
I would have hated to see my own snuffed out. At that time, I probably would not realize the impact. But today I would, and do not want anyone with inclination to self-learn, grow, do, build, experiment, teach, go into business, to lose any of that inclination just because we see some bad times right now.
"Tech" isn't fun anymore but actual technology is still fun.
In my case, it resulted in a trip to a neighbors house where I could input and run some programs. Mine didn't work, but it did not take too long to fix that.
I just noticed that microsoft has also released the source to MS-DOS 2.0: https://github.com/microsoft/MS-DOS
I don't think I ever imagined that I'd be able to "look behind the curtain" like this, let alone that Microsoft would come to embrace open source.
From there I moved on to Turbo Pascal 3.0, and then Borland Pascal 7.0 (which I loved - super fast compiler and superb IDE - many examples and comprehensive documentation - which were a must in the pre-Internet era), then Borland C. And then Linux and gcc for the following two decades.
It was the first time I ever saw him just stare in awe at me like I was an alien's child! :)
I then went on to use the various Borland products.
Nor could I. But I think that's ok.
I remember trying to make a game using a BASIC interpreter on Sinclair ZX80 Soviet clone and failing. Yet, here we are on HN taking about tech and leading lives in tech, whatever that means for us.
I don't know where I'm going with this, but I'm glad for that experience and where it got me. And, I guess, I'm glad that you're here as well, stranger.
I think Visual Studio 6 is equivalent in ease of use and user experience -- that's what I learned C++ on back in the early 2000s, before the influx of Java and Python into academia.
I've tried in DOSBOX, using this MASM from this (possibly sketchy?) site: http://www.mediafire.com/file/x13v7gqqmw1pom7/8086_Assembler... . The output is as follows:
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
Object filename [GWMAIN.OBJ]: Source listing [NUL.LST]: Cross-reference [NUL.CRF]: End of file encountered on input file
GWMAIN.ASM(3568): warning A4085: End of file, no END directive
Open segments: CSEG
OEM.H(55): warning A4016: Reserved word used as symbol: SHORT
OEM.H(102): warning A4016: Reserved word used as symbol: LENGTH
OEM.H(165): warning A4016: Reserved word used as symbol: LENGTH
End of file encountered on input file
GWMAIN.ASM(3568): warning A4085: End of file, no END directive
51620 + 169980 Bytes symbol space free
4 Warning Errors
1 Severe Errors
TASM (version 2.5) gives a similar error.I think you're on to something here, though!
--------- ---- -- ---- ----- --- ---- -----
COPYRIGHT 1975 BY BILL GATES AND PAUL ALLEN
--------- ---- -- ---- ----- --- ---- -----
ORIGINALLY WRITTEN ON THE PDP-10 FROM
FEBRUARY 9 TO APRIL 9 1975
BILL GATES WROTE A LOT OF STUFF.
PAUL ALLEN WROTE A LOT OF OTHER STUFF AND FAST CODE.
MONTE DAVIDOFF WROTE THE MATH PACKAGE (F4I.MAC).
I love comments like these. They also say that the GW refers to Bill Gates, as in Gates William but I don't know the details on that.https://github.com/microsoft/GW-BASIC/blob/master/GWMAIN.ASM
Edit: Forgot to say, I was 3 years old when they wrote this code, wow! and I learned programming with GW-BASIC in the late 80's.
> There are several theories on what the initials "GW" stand for. Greg Whitten, an early Microsoft employee who developed the standards in the company's BASIC compiler line, says Bill Gates picked the name GW-BASIC. Whitten refers to it as Gee-Whiz BASIC and is unsure if Gates named the program after him. The Microsoft User Manual from Microsoft Press also refers to it by this name.[citation needed] It may have also been nicknamed Gee-Whiz because of its numerous graphics commands. Other common theories as to the initials' origins include "Graphics and Windows", "Gates, William" (Microsoft's president at the time), or "Gates-Whitten" (the two main designers of the program).
If they said it was say, something like George Wallace Basic, because they segregated it from IBM basic and only put it on the clones as a "separate but equal basic" I wouldn't think twice.
I can even imagine the meeting
"We can't say this is George Wallace basic, no".
"Fine, it's GW basic. Say it means gee wiz or some shit, just make something up"
;The following block of externals was added on Dec 19, 1982 when BINTRP was
; Split up after the freeze of GW-BASIC Version 1.0
; This Split-up was not reflected in the PS1:<BASIC>BINTRP.MAC source.
; See Tom Corbett if you have any questions.If I remember correctly, the size of a compiled GWBASIC.EXE file was about 80 kB.
What feels weird though is seeing all the files on GitHub last modified "38 years ago," which by the way, also includes the file CODE_OF_CONDUCT.md.
I think it wasn't until Vim 8 that the default for .md files became markdown.
(Vim 8 was released in September of the same year.)
I am a bit rusty but this sows the problem:
10 L = 4720 FOR I =1 TO 1000 STEP 2
30 PRINT I%
35 IF I = l GOTO 6999
40 NEXT
6999 STOP
What you needed to do was set I to the end condition as part of the break out of the loop.
There was also a lot of aggressive compression done to reduce program size PET in particular munged every thing up putting as many statements on one line as possible
10 is always CLS
ON X GOTO 200,300,400,500 depending if x=1, x=2,x=3...
They'd obviously used the same parser for the standard "If a=1 then goto 200" construct, which allowed an undocumented shortcut of "If a=1, 200" which a few people noticed and started using. However, a later model fixed this, which broke a number of programs.
I could have Told BillG that was bad idea back when I was 19
x = x + (x < 5)
:DNo If needed.
Atari Basic would allow crazy things like:
10 Goto ((x < 5)*100) + 50
Goes to either line 50 or 150, depending on the comparison result being 1, or 0)Or...
Goto (100*x)
Faster On goto with no checking, lol.Bill Gates was not involved with the original Atari Basic. That could be purchased on a cartridge for running MS Basic programs.
Yes, it used 0 and 1. And it did not contain bitwise ops. Those were quite the surprise!
My first efforts were in Applesoft. Computers at school. Got an Atari machine and programmed the crap out of it. Wrote my own assembler, a few games, etc...
Then I got an Apple and finding them in Applesoft was a nice surprise! Prior to that, I thought they were an assembly only thing.
The trade off in the Atari basic was doing things mathematically was pretty easy and it generally, but not always, was faster.
A few of us wrote fairly complex programs with basically no if statements. Kind of a fun way to think about things back then.
I much prefer -1 and 0 and the bit ops, frankly. Internally, I remembered this kind of thing as "really fucking true" as in every bit better signal, or it's false!
On the other hand, one thing that BASIC still has to this day (in VBA) that no other language I can think of does, is bitwise equivalence (EQV) and implication (IMP) operators. Furthermore, since VBA has a Boolean data type, these operators are also available for Booleans; implication comes in handy sometimes.
I had no idea about those VBA features. Will read about them.
Having the bit ops themselves is a very strong feature.
My simple assembler would definitely been faster and simpler with them. Graphics, some math, all benefit. People would make little language extensions or callable machine language routines to make the bit ops available.
In basics with bit ops, and the -1 as true:
X = 100 & (y = 5)
Atari
X = 100 * (y = 5)
Not doing the multiply seems like a net gain in a limited CPU too. That basic did not really have types, like MS basic did. Pretty much floating point only.
Interestingly, basics that have the bit ops do not always allow the expressions in a goto. Or, could just be my own memory, or lack of trying. Not really needed.
In fact, outside of trying to optimize, or just explore the language, the only case that made real sense was a sort of jump table making good use of line numbers like one would do with memory addresses in assembly.
Say, branching directly on a checked or masked character value.
And the spiffy thing was making pseudo labels. Put line numbers into variables and use them like labels.
Foo = 1000
Goto Foo
Overall though, it was a weird little basic. It nicely supported the machine, and the device independent I/O system in the OS ROM, but was slow otherwise.
This guy has actually made an N: driver meaning Atari Basic programs written long ago can operate across the Internet today.
Lol, cool old stuff.
Most modern languages are like that, but BASIC is an exception to this day - even VB.NET still doesn't do short circuiting by default. You need to use special operators, AndAlso/OrElse, to get it.
Computing the line number in a GOTO is definitely an extension - the original Dartmouth BASIC never had anything like that. For jump tables and such, you were supposed to use ON..GOTO.
Yeah, the computed goto is odd.
Back in the day, I used it and some conditional math to greatly shorten and improve performance in some programs. My first machine was only 16k. Using the graphics system in any meaningful way cost a lot in terms of program space. So, every dirty trick, including poking new addresses into string variable address pointers to overlap the graphics screen got done.
Absolutely terrible code though. I am sure if I saw some of that code today, I would have a bugger of a time sorting it out.
IF a=1 THEN 200
and when they added ON..GOTO, they basically made these two mirrored syntactically. So you could do: IF a=1 GOTO 200
ON a THEN 100,200,300
(I suspect it was simply treated as identical token?)At the time we felt enabled rather than held back. But many Microsoft products were like that. The OS on a BBC micro was far ahead of DOS. Then the whole concept of the personal computer took hold even though we had already seen networking. Then the browser wars.
Now we learn that Linux is to be in Windows good and proper. So we are getting there in the end.
By 80s, when structured programming became the norm, BASIC became more structured as well, with loops and subprograms.
I ended up studying electrical engineering, really liking the notion of using digital systems to control the real world, and am a network and security consultant for my day job.
That's the first day I remember not liking Microsoft.
As late as the 486 era I remember how often it was reminded to people to just disconnect the PC Speaker. I also recall there were also crazy case mods where people would add a switch to their cases to add an on/off button.
That said, I totally blame Microsoft for thinking that ringing the bell was in any way acceptable. Even if the PCs of the day had a soothing, quiet 'ding' sound, emitting that for every compiler diagnostic was the height of stupidity. As it was, I recall the original PC bell sound as more like gear grinding, if your head was one of the gears.
(Even if more POSIX terminals these days make the bell actually sound like a bell or use a simple visual "nudge" instead and not the poor buzzsaw of an early DAC wired to a cheap speaker because it was free parts just laying around during the invention of the IBM PC, it's still amazing that terminals ever had a bell signal, as annoying as it can be, much less that apps intentionally used it or that it will forever be ambered into Unicode even. Learning to type a bell was a rite of passage for DOS kids, maybe with pseudo-terminals coming back into fashion it will be a thing kids learn again.)
When I wrote the BASIC interpreter that runs in your web browser (using Java) I modelled it after GW-BASIC as this was the BASIC that had the most number of test cases I could find.
Given that we've got DOSBox for running DOS in your browser this should be portable to that sort of environment right? I know playing HAMMURABI and TREK isn't very engaging to the cool kids these days but they were a big component of the early microcomputer "revolution."
> Each of the assembly source files contains a header stating This translation created 10-Feb-83 by Version 4.3
> Since the Instruction Set Architecture (ISA) of the early processors used in home and personal computers weren’t spectacularly different from one another, Microsoft was able to generate a substantial amount of the code for a port from the sources of a master implementation. (Alas, sorry, we’re unable to open-source the ISA translator.)
> Alas, we’re unable to provide sources for these ports and/or customizations.
I wonder why. (I guess it might involve code licensed from third parties, co-developed and jointly owned with OEM vendors, or unclear provenance of IP.)
I wonder if it will ever change. I hope one day it does.
One of these days (probably long after I'm dead) the copyright will expire. I hope the source code hasn't been lost by then. (Sadly, there's a decent chance it will have been.)
My dad was an autoworker. I've built foundational services and products now in the homes of 100s of millions & to this day I'm still astounded by what my old man pulled off.
I also remember it had a graphics mode -- Hercules card, ambar monochrome monitor -- which sort of resembled Logo's turtle. You gave directions to a sort of pencil tip. I don't remember what the statement was called, but I remember I used it to program games.
I owe a lot to GW-BASIC :)
> ORIGINALLY WRITTEN ON THE PDP-10 FROM FEBRUARY 9 TO APRIL 9 1975
Wow! I did not realize that it was written so quickly. Two months that literally changed the PC landscape forever.
This is pop computing.
Woz wrote Apple integer BASIC in the evenings while working at HP in just a few months. Guys were writing crazy stuff at the time. The original version of DOS that Microsoft bought to license to IBM for the PC was written in 6 weeks.
I feel often the need to remind programmers, that they don't write code for the computer. The computer will make it obvious, whether it understands you or not. You write for the poor sod tasked to maintain your code three years from now, when you're at your next gig.
Sure you can usually use import/aliasing to narrow it, but sometimes you just need to grab some random global from somewhere.
Is this actually true? From https://en.wikipedia.org/wiki/Tim_Paterson
When a book appeared in 2004 claiming that 86-DOS was an unoriginal "rip-off" of CP/M,[6] Paterson sued the authors and publishers for defamation.[7][8] The judge found that Paterson failed to provide any evidence regarding "serious doubts" about the accuracy of the Gary Kildall chapter.
It wasn't a direct copying of the code, but the API was largely similar to CP/M.
Gates and Allen had already been working on PDP-8 and Data General versions for a while.
I apologize for not taking current economic conditions into consideration with what was clearly a poorly-worded post.
(with stack overflow blocked)
(I started with 6800 / 6809 assembly language, and then Microsoft C 4.0).
Also: PDP-10 (TENEX) was awesome to use, was a very nice development platform.
It is interesting now to see Microsoft going back to its roots as a provider of developer tools for multiple platforms.
It was on essentially ticker-tape, which was the medium at the time (wikipedia's photo: https://en.wikipedia.org/wiki/Altair_BASIC#/media/File:Altai...)
Paul Allen was still "writing" it on the plane which in this case meant taking careful notes, cross-checking it very carefully and then manually punching holes into the paper. This is 1975, laptops are many years away.
It'd take about 30 minutes to load into the machine. Paul Allen claims they were the longest 30 minutes of his life. The MITS people were just smiling and waiting patiently, eager to see the cool software while Allen, on the other hand, had absolutely no idea whether it would work or not (they wrote it on an emulator after all).
After the 30 minutes it was ready to go and bam, everything worked. Bill and Paul had a company. Microcomputer software was now a thing.
Maybe I should do a computer history podcast ... I just checked and I don't really like most of them ... The video game crash of 1983 for example, I'd do at least 10 30 minute episodes on. The NES came out of it. I mean yeah, at least 10 episodes. I'll pick something super small (for example the HP 9100a) and see how it goes
Micro-soft BASIC on Apple ][, as on other 8-bit targets, infamously did a linear search from the beginning of the program to locate the target of a GOTO or GOSUB statement, so that programs ran faster if frequently called subroutines (what we now call functions) were close to the front. I wonder if or when that behavior was ever corrected in GWBASIC. Also, did the NEXT statement do it too?
Hah! This is the real mystery, isn't it? I noticed Wikipedia has a section on the topic (without resolution): https://en.wikipedia.org/wiki/GW-BASIC#Name
How does all this assemble into a 60k binary?!
Also, wasn't it true that Steve Wozniak was able to bootstrap the entire Apple I BASIC in hexadecimal from his own memory? How can that be? I'm reeling.
And I can imagine that this is an absolute ear pull to try to debug with the tools they had. It's more akin to debugging embedded systems to the PCs we have today.
BILL GATES WROTE A LOT OF STUFF
For...legal reasons? Or because they lost it?
1. Computers are so much more advanced now, that the obvious gap between beginner and commercial software is vast. This can be discouraging. When I learned BASIC, I could write programs that didn't look any more crappy than typical commercial software, even if there was a performance gap.
2. There's more magic involved today, meaning that when you run into an obstacle, you wave a wand and a library or stackoverflow post magically appears. To do something in the old BASIC, you had to figure out a way to compose it out of the 13 keywords that you had already learned. So you were forced to think about algorithms, right off the bat.
3. You were closer to the hardware, which was more exciting if you were interested in things. I could kinda explain what the computer was actually doing. I loved math as a kid, but I also loved electronics. The day that I programmed a thing to do something (maybe just a blinking LED) was like the rapture for me.
What's closest to the old experience for me is not a language, but a thing: A microcontroller board. Out of the box, it has no GUI, so no expectations for what "cool" software looks like. And you can make it do things that have an immediate sensory effect. You can now put CircuitPython on a Teensy 4.0 board, and sidestep having to learn C, at least for a while. And your son can really own the thing that he's programming.
As a minor suggestion, you can also get closer to the computer and to programming by making more use of the command terminal when showing your son how to do things.
A final word, don't be heartbroken if it doesn't click. It might not. This is also something parents are told when their kids start music lessons.
The closest thing I'm aware of today, that are actually useful, are the 8 bit PIC chips.
Also, I can't help thinking of how it can be counterproductive to try to push someone in a certain direction.
A lot of times showing what you value and want for yourself tends to have more influence than what you try to get others to value.
It also helps they use known franchises like minecraft or angry birds =)
Python itself is great because it has all the right batteries included. It's easy to get started - you don't need to explain "import" or functions to write a basic hello world type app with console input and output. Then you can gradually build it up from there, introducing turtle graphics, databases (SQLite), and finally GUI (Tk) - all of which are present in the standard library.
And Thonny, well - it's self-explanatory once you see it: https://www.youtube.com/watch?v=nwIgxrXP-X4
Microsoft made GW basic and smited IBM by putting it on the clones Except for the IBM machines. They also intentionally made it slightly incompatible with IBM's basic. Then they held the GW basic source hostage so IBM couldn't resolve the inconsistencies, couldn't backwards engineer it because of the licensing, and thus put them at a losing negotiating position since Microsoft now called the shots because they controlled the software. (I wonder if this slight is in the comments, let me go look, that'd be great[2])
Microsoft also held the DOS source code hostage and it was a huge stickling point in the OS/2 and Windows work and was a significant reason Microsoft was able to steal the show from IBM. IBM even sent over a bunch of engineers to get DOS 2 to work because DOS 1.1 was a complete mess. But they didn't have the rights to walk out the building with the source they wrote due to a contract oversight.
Bill Gates was a true software Napoleon, it's really quite something.
Now they're releasing all of it. It's a strange coincidence to pick the three they burned IBM with 35 years ago...
Maybe they're trying to shake off the old days, maybe they're putting a final stick in IBMs eye, maybe it's genuinely unrelated, who knows.
Smacking around IBM is my preferred reading because the idea of doing one final power play, against IBM for God sakes, 25 years after it became unarguably 100% meaningless with the release of Windows 95, I personally find hilarious.
---
[1] The only source code left in the timeline we don't have is Phoenix, who cleanroom cloned IBM's BIOS in 1983 (using a Chinese Wall) which allowed the clones to really take off. But they've been pieced off and sold as a fleamarket to HPE, Absolute, and Marlin, so who knows when we'll see that source.
[2] I'm going to make the bold claim (after 10 minutes of poking) and say either they removed the incriminating things or the claimed intentionality of the incompatibility is now provably just a rumor (as in they lucked into it through implementing an imperfect clone)
There's evidence for both I guess. For instance, GIOCOM.ASM has a reference:
COMPAQ=0 ;Include IBM 1.0/1.1 Bugs for compatibility
But this isn't cited anywhere else. It's just hanging. They have a bunch of other vendor specific things like ZENITH, TSHIBA, they all have logic, this one is absent any logic, it's just an orphan. Shrug...
I just tweeted @ BillG and asked him --- snowballs' chance he'll respond but who knows.
I am, to put it mildly, not the greatest fan of Microsoft, or of most of their products. But that just sounds like a flag to avoid breaking backwards compatibility by fixing bugs that people have come to rely on.
And a strong focus on backwards compatibility most certainly is a principle by which Microsoft operated for years.
https://www.joelonsoftware.com/2004/06/13/how-microsoft-lost...
It might have given IBM more leverage to say "not fully compatible" or instigate IP lawsuits, but most clones seemed to be okay with a boot error of "NO ROM BASIC - SYSTEM HALTED" instead of the IBM BASIC ROM.
They stopped updating the ROM version virtually immediately, and it never supported discs. No PCs after the PCjr supported cassette tape natively. So all it could be was a penalty box when the boot failed.
BASICA and GWBASIC seemed to be treated equivalently from the perspective of mid-late 80s magazines with type-in listings of near commerical-grade for the time software.
; There is a problem with running the ASM86 sources for BASIC as they
; stand. MSDOS puts a 100 hex byte control block at the beginning of the
; EXE file and sets up the ES register to point to it. BASIC, however,
; expects this block to be at 0 in the code segment.
https://github.com/microsoft/GW-BASIC/blob/master/BIBOOT.ASMI forgot the details, but I remember that my XT clone had does MSDOS 2.11 and whatever version of gwbasic came with that, and MUSIC.BAS would always play the notes slightly out of sync with the visuals, and the prompt would return before the last note played.
Some day I saw it running on a friends machine, and there everything looked fine. I copied his gwbasic.exe and lo and behold, now it worked on my machine too. The version numbers were also different, but I couldn't tell you either one now.
PC Basic emulates GWBasic on many platforms.
And from there, once you hit QuickBasic's limitations, it was a small step to Turbo Pascal or Borland C!
"QuickBasic" was the commercial compiler (like QuickC and QuickPascal), whereas "QBasic" was the stripped down IDE with interpreter that a Gorilla throwing bananas based on physics.
Memories.
At that point the only documentation we had access to was the IBM Technical Reference Manual, which gave the schematics and BIOS listing, but little else.
I was very familiar with GW-BASIC and had written some BASIC code to use the RS232 serial interface from it, so decided to reverse engineer GW-BASIC itself, to work out how it was addressing those chips.
A month or two later, we came across Peter Norton's "Programmers Guide to the IBM PC", which could have saved us weeks.
Exciting times.
Now, a few software engineering observations (these are to my future self, not to Microsoft):
1) This is extremely minor, but it would have been nice if the main file (which I'm guessing is GWMAIN.ASM?) had been pointed to in the documentation. Reason: We're not in a language that has a default main file by custom, i.e., C's 'main.c'. But again, extremely minor...
2) This code is great, I mean, absolutely great for someone to learn x86 programming IF they have the prerequisite understanding about how memory is segmented in those early computers (including segment registers, etc.)... Reason: Very few basic x86 instructions are used, relative to the entire x86 instruction set...
3) It seems that the assembler which was being used at the time had a limitation of 6 characters per symbol. This kind of sucks a little bit for the readability of those symbols (but note that the code makes up for this with liberal commenting, which is great!), and of course, with a little bit of effort, you can mentally parse what most of these mean.
4) I would have liked to see some kind of document (although, since it's 38 years "after-the-fact", after this program was being written, I certainly don't expect one! <g>) which, at a high level, would describe the main data structure being used to hold the lines of basic code (I'm guessing this would be a linked list of sorts), in what source file that data structure lives, and how it is evaluated when a BASIC program is run...
Basically, give me the high-level view of the system.
The code itself represents the low-level implementation details of that high-level "as simple as possible but not simpler", view...
But again, those things are minor, relatively speaking, and they only amount to "notes to self" in my future software engineering efforts...
Anyway, thanks again to Microsoft for this great important contribution to computer history!!!
git commit --amend --no-edit --date="Fri Nov 6 20:00:00 2015 -0600"
I'd love QBasic from a few years later.
I'd also love a nice, easy-to-run Ubuntu .deb for either.
https://github.com/QB64Team/qb64/releases/download/v1.4/qb64...
In their implementation, BASIC code is transpiled to C++ first, then compiled and executed.
There would probably be a few "Ah Hah!" moments for code that stumped them, and lessons to be learned on any particular errors they made.
Prior to that my dad had a Tandy TRS-80 model III but at that point I was 6 or 7 and my typing skills were holding me back from writing more than 3 or 4 lines of code.
It was scary to see it when you didn’t expect to, because that meant something was wrong with your disk drives!
I've always thought that using BASIC as the default command line was really weird... Like on an Apple II or TRS-80. You could type in a command to load something from a disk or run a program, or type a line number to start programming. How did that make sense to anyone?? To my 11yo self, it was confusing and I've never changed my mind.
I don't know how common that setup was - probably not very. The most typical stripped-down PCs were dual floppy (the hard drive was a premium), and booted either MS-DOS or CP/M.
--------- ---- -- ---- ----- --- ---- ----- COPYRIGHT 1975 BY BILL GATES AND PAUL ALLEN --------- ---- -- ---- ----- --- ---- -----
ORIGINALLY WRITTEN ON THE PDP-10 FROM FEBRUARY 9 TO APRIL 9 1975
BILL GATES WROTE A LOT OF STUFF. PAUL ALLEN WROTE A LOT OF OTHER STUFF AND FAST CODE. MONTE DAVIDOFF WROTE THE MATH PACKAGE (F4I.MAC).
If only I had :)
Also love the remark about high level languages and the choice to go with Assembly, no kids, C wasn't always as fast as you have been sold on, specially on home computers.
Considering the repository is 80's assembly code, I have no idea how to rebuilt it.
> When writing software for early PCs, every single byte and every single instruction mattered, so developers often wrote code entirely in assembly language simply to be able to physically fit their software into the available memory, and to be able to access the computer’s resources and internal workings.
This made me a bit sad. Imagine how fast things could be today if developers still had this mindset. Of course I wouldn't advocate writing everything in ASM, but the adage that computers are fast, write inefficient code...is disappointing to say the least.
ISTR hearing that MS had a VAX that they developed on then cross-compiled for 8086
However, I do find GPIB programming examples in what seems to be Rocky Mountain BASIC (HP BASIC / HT BASIC) in the manuals of measurement devices from the seventies to the early nineties. Analog electronics didn't evolve nearly as quickly over the last forty years as digital, so some of those instruments are still significant today (chiefly to hobbyists, but at least the HP 3458A, introduced 1989, is still produced virtually unchanged and is even today the top-end long scale-scale DMM).
I like to see a OSS implementation of that dialect (for Linux).
.RADIX 8 ; To be safe
To be safe of what exactly?
So my guess this is to allow 12 octal to be 10 decimal as that would have been the default in the inital code base.
So what is the point of publishing this? All we learn that "Every Line Must Have Comment" in Microsoft.
CLC ; Clear Carry[0] https://github.com/microsoft/MS-DOS/blob/master/v2.0/bin/MAS...