Live data from Hacker News

The original source code of Microsoft GW-BASIC from 1983

devblogs.microsoft.com

261–270 of 272 posts

Re: The original source code of Microsoft GW-BASIC from 1983

#261

Earlier quoted context omitted.

https://atariwiki.org/wiki/Wiki.jsp?page=Boolean%20Logic%20i... 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 a…

The problem with using bit ops as logical is that they don't short circuit. Although it was unfortunately common even in languages that had proper Booleans at the time - e.g. standard Pascal didn't have it, and Turbo Pascal required a compiler directive/switch to enable it, which few even knew of. So it feels worse in retrospect than it actually was back then. On the other hand, one thing that BASIC still has to this…

Not sure what you mean by short circuit.

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.

https://m.youtube.com/user/tschak909

Re: The original source code of Microsoft GW-BASIC from 1983

#262

Earlier quoted context omitted.

Just realised we have Apple computers, Apricot computers, Blackberry phones, Raspberry (Pi) computers – is there some kind of fruit obsession in IT I've missed out on?

There was Apricot too, https://en.m.wikipedia.org/wiki/Apricot_Computers . And Cherry made peripherals/components, https://en.m.wikipedia.org/wiki/Cherry_(keyboards) . I guess such names make for simple logos.

I mentioned Apricot :)

Cherry, yes – good catch!

Re: The original source code of Microsoft GW-BASIC from 1983

#263

Earlier quoted context omitted.

> There's nothing like the joy of programming for the very first time 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, bu…

C doesn't have "public" and "private" at all. Java has them for both functions and variables (so long as they are members), as does Delphi. The only difference between the two in that regard is that Java requires visibility on every declaration, while in Delphi using the keyword sets it for all following declarations, until another keyword changes it. On the whole, I don't see a problem with doing Delphi (or Free Pas…

You're right about C; I forgot that Java added it.

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.

Re: The original source code of Microsoft GW-BASIC from 1983

#265
post #11

Earlier quoted context omitted.

While it might initially feel like a downer, it would still be quite educational on its own to go through the code comparing what they came up with in the disassembly in light of the real deal being now published. 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.

They are different. That project is disassembling Microsoft BASIC for 6502. What Microsoft has just open sourced is their BASIC for 8086. Two separate codebases, although they have some commonalities. (As the MS blog post mentions, they kept master source in some kind of abstract assembly which could then be automatically translated into specific machine's assembly language, but then I believe there were manual addit…

That does explain the top line comment in each source file. Thanks. I was wondering what they meant.

Re: The original source code of Microsoft GW-BASIC from 1983

#266

My first foray into BASIC was BBC BASIC. I was an 11 year old in the eighties and attending comprehensive secondary school in the UK. 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) load…

Is it really a good idea to be just as enthusiastic about tech now as you were then? Few things are what they say they are any more. Everyone's clawing at your personal data. With a few large exceptions, all the innovation goes to things make both us and tech cost less to management, or manipulate our attention, or track us because business types think theres gold in them thar hills. Half-assed attempts at things lik…

All of the things you listed are why I work in embedded systems / IoT rather than web stuff.

"Tech" isn't fun anymore but actual technology is still fun.

Re: The original source code of Microsoft GW-BASIC from 1983

#267

Earlier quoted context omitted.

x = x + (x :D No If needed. Atari Basic would allow crazy things like: 10 Goto ((x 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.

Did Atari BASIC use 1 for TRUE? Most BASICs used -1 (i.e. all bits 1), because this allowed the same operators to work for both bitwise and Boolean logic, in the absence of a dedicated Boolean data type.

There were no bitwise operators in the Atari BASIC, and numbers in the tokenized program were always stored as floating-point numbers in BCD (Binary Coded Decimal) format.

Re: The original source code of Microsoft GW-BASIC from 1983

#268

Earlier quoted context omitted.

The problem with using bit ops as logical is that they don't short circuit. Although it was unfortunately common even in languages that had proper Booleans at the time - e.g. standard Pascal didn't have it, and Turbo Pascal required a compiler directive/switch to enable it, which few even knew of. So it feels worse in retrospect than it actually was back then. On the other hand, one thing that BASIC still has to this…

Not sure what you mean by short circuit. 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 tru…

Short circuiting means not evaluating the right side if the left side is sufficient - so e.g. in (Foo() OR Bar()), if Foo() returns true, it won't even evaluate Bar().

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.

Re: The original source code of Microsoft GW-BASIC from 1983

#269

IBM had their own Basic, 4 of them really (collectively called IBM Basic) that was a barrier for the clones[1] (eg, Compaq, Dell, etc) because they wouldn't license it. (You probably used one of them, basica if you used the classic PC) 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 t…

I'm not sure that the ROM BASIC was a huge commercial factor much after 1983 or so.

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.

Re: The original source code of Microsoft GW-BASIC from 1983

#270
post #56

The funny thing about this announcement is that a week ago I just found my old QBASIC textbook that I learned how to program with back in 1998. QBASIC was my very first programming language; I was a nine year old kid who loved computers and would read anything computer-related that was available, including my mom's textbooks (she was returning to college at the time and took some courses on computing and applications…

If you love QBASIC you might be interested in the qb64 project.
Post reply on HN