Live data from Hacker News

Microsoft GW-Basic Interpreter Source Code

github.com

81–90 of 101 posts

Re: Microsoft GW-Basic Interpreter Source Code

#82

Earlier quoted context omitted.

An 8080 has what, 40 opcodes? All doing simple things like "add" and "mov". https://altairclone.com/downloads/manuals/8080%20Programmers...

I learned on an 8080 system (Interact) that also had MS basic. Almost every one of 256 op-codes is used on the 8080. That's not to say there were that many instructions. For example register-to-register move might be considered one instruction but the source and destination register are encoded into that one byte so there are many reg-reg moves. Same with add sub, etc... My father wrote a disassembler in basic to rea…

https://pastraiser.com/cpu/i8080/i8080_opcodes.html

As a pragmatic manner, I don't regard having the register and/or addressing mode encoded into the opcode as a separate opcode.

Emulating a modern 64 bit processor would be a major chunk of work, but the old 8 bit ones are simple.

Re: Microsoft GW-Basic Interpreter Source Code

#83

Earlier quoted context omitted.

Interesting! Could you explain in a bit more detail how you used it for your CS project?

Oh I just mean, QBasic was the language I used for that project. I can't actually remember it in detail now, but this was when I was 15 or 16. It was a database application; I guess mine would have been music lending. I wonder if I still have the code. I definitely still wish I had the book . I really enjoyed QBASIC because of the gentle way you were exposed to better programming practices; I've always admired that.…

Python seems to have taken its place, specially with all school calculators having some variant of MicroPython.

It isn't the same thing though.

Re: Microsoft GW-Basic Interpreter Source Code

#84

All of the "comments are useless because they get out of date" folks should look at this code, which is still comprehensible 40 years later because of the comments.

75% of assembly programming is writing comments.

And figuring out meaningful jump target labels. :)

Re: Microsoft GW-Basic Interpreter Source Code

#85
post #47

Earlier quoted context omitted.

Yes. And, there are other possible expansions, e.g. Gates William. This is likely no different than the MZ in the DOS exe header. Nobody actually knows (and says!) what MZ stands for, but it is believed to be Mark Zbikowski.

Pretty sure it is Mark Zbikowski.

I believe that, too. However, for something like a zip file, I KNOW that the PK in the header stands for Phil Katz.

Re: Microsoft GW-Basic Interpreter Source Code

#86

Earlier quoted context omitted.

An 8080 has what, 40 opcodes? All doing simple things like "add" and "mov". https://altairclone.com/downloads/manuals/8080%20Programmers...

I learned on an 8080 system (Interact) that also had MS basic. Almost every one of 256 op-codes is used on the 8080. That's not to say there were that many instructions. For example register-to-register move might be considered one instruction but the source and destination register are encoded into that one byte so there are many reg-reg moves. Same with add sub, etc... My father wrote a disassembler in basic to rea…

Yes, around 8 spare opcodes, and they were the ones Zilog used to escape into a large set of extensions for the (backwardly compatible to 8080) Z80.

Re: Microsoft GW-Basic Interpreter Source Code

#87
post #83

Earlier quoted context omitted.

Oh I just mean, QBasic was the language I used for that project. I can't actually remember it in detail now, but this was when I was 15 or 16. It was a database application; I guess mine would have been music lending. I wonder if I still have the code. I definitely still wish I had the book . I really enjoyed QBASIC because of the gentle way you were exposed to better programming practices; I've always admired that.…

Python seems to have taken its place, specially with all school calculators having some variant of MicroPython. It isn't the same thing though.

Yes -- I think sort of the most basic BASIC programming is done with Scratch, and then they graduate to Python.

In the UK I gather kids are taught Scratch and Python in an overlapping fashion, so they see the structure on the Scratch view and then have a better chance of understanding how the code works without being thrown off by the symbols.

This is probably better in a pedagogical sense, and I am sure Scratch programmers have a better early understanding of flow control and things like loop termination conditions than BASIC programmers did; Scratch makes it more physical.

But it does lose that absolute immediacy of being able to type simple words onto an empty screen and see it do things.

Re: Microsoft GW-Basic Interpreter Source Code

#88
post #20
post #7

Earlier quoted context omitted.

I wonder why. Uses third-party code? Some contractor/consultant/etc wrote it and they can't find the contract so they don't know what it says about copyrights? Lost it completely?

Likely something like that. My money is on them being unable to locate someone who needs to give permission, and it's probably not a very high priority issue. I vaguely recall reading a blog post when Sun opened the Solaris source code, that it was a tremendous effort tracking down every single person they needed permission from.

And then Oracle went and undid almost all that work :'(

Re: Microsoft GW-Basic Interpreter Source Code

#89

Earlier quoted context omitted.

I learned on an 8080 system (Interact) that also had MS basic. Almost every one of 256 op-codes is used on the 8080. That's not to say there were that many instructions. For example register-to-register move might be considered one instruction but the source and destination register are encoded into that one byte so there are many reg-reg moves. Same with add sub, etc... My father wrote a disassembler in basic to rea…

https://pastraiser.com/cpu/i8080/i8080_opcodes.html As a pragmatic manner, I don't regard having the register and/or addressing mode encoded into the opcode as a separate opcode. Emulating a modern 64 bit processor would be a major chunk of work, but the old 8 bit ones are simple.

If we exclude addressing mode then I think there are less than 26 instructions. Our mnemonic format was one letter (verb/op), one for source (a,b,c,d,e,h,l,w,x,y) and one for destination. I dont recall the letter for immediate, probably i but MIA for move immediate to a doesnt ring a bell for me. :-)

Re: Microsoft GW-Basic Interpreter Source Code

#90

Earlier quoted context omitted.

I learned on an 8080 system (Interact) that also had MS basic. Almost every one of 256 op-codes is used on the 8080. That's not to say there were that many instructions. For example register-to-register move might be considered one instruction but the source and destination register are encoded into that one byte so there are many reg-reg moves. Same with add sub, etc... My father wrote a disassembler in basic to rea…

Yes, around 8 spare opcodes, and they were the ones Zilog used to escape into a large set of extensions for the (backwardly compatible to 8080) Z80.

Can a Z80 be dropped into an 8080A socket? I'm thinking there were hardware differences.
Post reply on HN