Live data from Hacker News

The original source code of Microsoft GW-BASIC from 1983

devblogs.microsoft.com

181–190 of 272 posts

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

#181
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…

Huh. There's a very well-commented disassembly of Applesoft BASIC in existence already that shipped with the MERLIN assembler. I assume those guys already have that one.

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

#182
post #99

Earlier quoted context omitted.

Microsoft BASIC was all over the place in the late 70's and early 80's. Before MS-DOS, Microsoft was basically a programming languages company (and they still are today). They licensed their BASIC to many other companies, even Apple. https://en.wikipedia.org/wiki/Microsoft_BASIC

And I think most if not all MSBASIC ports for early PC's had a memory leak if you did not break out a FOR loop in the right way. 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 progra…

10 CLS

10 is always CLS

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

#183

I wasn't particularly aware of it, but it looks like the TRS-80 BASIC that introduced me to programming was also probably developed by Microsoft, and I'm pretty sure that AmigaBASIC was as well. I think I also used QuickBASIC on the Mac a little, but what I particularly remember was a demo for it that visually showed different sorting algorithms, that inspired me to do something similar in Pascal.

Apple II and Commodore 64 as well. They were all over the place.

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

#184
Wow Microsoft's twisted marketing strategies know no limits. They try to seduce you into their way of thinking, not telling you about certain limitations and proprietary formats.

If they really cared about open source, they would open source their proprietary Microsoft Office suite document format (.docx etc.).

In the end their corporate DNA is programmed to care about charging money above all, by charging rent. That is the nature of all modern day national fiat currencies.

Microsoft is just one of those corporations that temporarily falls behind in a certain area of their sector, and then uses the open source community to catch up.

I saw someone call it 'fake open source' recently.

Let's go for Protocol Cooperativism using Ceptr.org instead. Commons based peer production! The biggest and most damaging black box/proprietary protocol is the money system today. It doesn't allow for a diverse enough view of the different types of wealth [1].

In solidarity

[1] https://medium.com/metacurrency-project/the-new-currency-lan...

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

#185
post #168
post #162

Earlier quoted context omitted.

Mentioned it in another reply, you'd probably want to start with the MASM and LINK from the MS-DOS 2.0 release. https://github.com/microsoft/MS-DOS/tree/master/v2.0/bin

Also, as written in the blog post, the .ASM files are not the original sources, more a temporary expansion of these for the given target. Looking at their binary form, all .ASM files end with zero characters instead of, for example, 0x1a with which .H files end. It can be that some tools (different than those originally used) have problems with the zeroes at the end?

That's a good observation. I tried stripping zeroes, but unfortunately it's the same error message.

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

#186
"Sometimes I just look in mirror and spook myself". In 1983 I wrote modern high-level language interpreter and compiler with backtracking and throw-catches (clojures sortof) in MSDOS assembler and it is much shorter than this GW-Basic. Admittedly I used macros like a madman on steroids. https://github.com/timonoko/nokolisp

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

#188

I really appreciate the nearly per-line commenting.

Sure, but opening a random file yields the comment: .RADIX 8 ; To be safe To be safe of what exactly?

Probably because the PDP & Intel 8080 were typically octal systems rather than hex, the 8080 instruction set decoded nicely in octal (or at least the MOV A,H instructions). By the time the 8086 arrived the micro-computer world had moved to hex as it nice decode mapping was broken by the Z80 and the 6502/68xx families didn't have that nice split.

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.

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

#189
post #162

Has anyone got it compiling yet? 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 i…

Mentioned it in another reply, you'd probably want to start with the MASM and LINK from the MS-DOS 2.0 release. https://github.com/microsoft/MS-DOS/tree/master/v2.0/bin

Unfortunately, I can't get MS-DOS 2.0 to run in DOSBOX ("Invalid COMMAND.COM") and running MASM.EXE directly gives me some really interesting errors (looks like it's reading uninitialized memory).

I think you're on to something here, though!

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

#190

"Contains no build scripts, makefiles, or tools required to generate executable binaries, nor does it contain any pre-built binaries / executables". So what is the point of publishing this? All we learn that "Every Line Must Have Comment" in Microsoft.

CLC ; Clear Carry

One line of quoted assembly downvoted. Dang?
Post reply on HN