Live data from Hacker News

The original source code of Microsoft GW-BASIC from 1983

devblogs.microsoft.com

141–150 of 272 posts

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

#141
post #97
post #83

Earlier quoted context omitted.

I wrote my first line of code on a game console without persistent storage. Coding is everything that makes computer a computer. Now, some kids in college have an impression that coding is less relevant for a CS career.

"Computer science is no more about computers than astronomy is about telescopes." - Edsger Dijkstra

That quote is misattributed and I also think it is not something Dijkstra would have said. Quite the opposite actually. However, I think this quote from him is much more beautiful:

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)

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

#142
Very nice commented code, it really looks like the best practices of some Assembly books back then.

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.

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

#143

I could not find the original macrotized version. As history tells it there was a version of this code that was written in a bunch of macros that were parsable by humans and they emitted assembly code for a wide variety of machines and architectures (from the 8080 to the 80286). 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 th…

The article seems to confirm your recollection of a macrotized "master":

> 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.)

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

#144

Wow, what a blast from the past. I learned to program with BASICA.EXE and GW-BASIC as a kid in the late 80's. 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 B…

Thirty years later, I still miss the Turbo Pascal / Borland Pascal, Borland C(++) experience. Few, if any, 'modern' IDEs have yet reached the simplicity and ease of that development environment.

I've been toying with Turbo Pascal 5.5 running on FreeDOS on an old laptop. There's something really relaxing about it, compared to modern programming.

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

#146
Some real cool things - this is computing history being preserved, like in one of the files I saw this:

--------- ---- -- ---- ----- --- ---- ----- 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).

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

#147

My mom's IBM 8088 had GW-BASIC built into its BIOS. You could turn on the computer and go straight into it without having any storage medium present.

Interesting. Was that the original IBM PC? I thought it needed DOS for some reason. 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…

Yes. The original PC and PC XT had BASIC in ROM just like all the other home computers of the day. In its most bare bones configuration, you booted into BASIC and used a cassette tape drive for your storage.

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.

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

#148
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 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.

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

#149
That's interesting:

    ; 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.ASM
Post reply on HN