Getting Microsoft BASIC source

Programming the 6502 microprocessor and its relatives in assembly and other languages.
Post Reply
User avatar
James_Parsons
Posts: 67
Joined: 10 Jul 2013

Getting Microsoft BASIC source

Post by James_Parsons »

Hi, none of ya'll probably remember me. Bu I am looking for a copy of Microsoft BASIC source code. I believe I have found it here: http://www.pagetable.com/?p=774 , but I am not too sure. Can anyone verify that this is Microsoft BASIC and not some sort of fraud?
JMP $FFD2
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Getting Microsoft BASIC source

Post by BigEd »

Hi James, yes, I remember you! Pagetable.com is Michael Steil's site, he's extremely credible. You can be sure this is the real thing. He's posted several analyses about various basics (and a lot more of interest to 6502 fans and Commodore fans)
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Getting Microsoft BASIC source

Post by GARTHWILSON »

There's also this one: Create your own Version of Microsoft BASIC for 6502, on the same site. (It's on my links page.)
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Benoit0123
Posts: 25
Joined: 28 Sep 2012
Location: Boulogne Billancourt, France
Contact:

Re: Getting Microsoft BASIC source

Post by Benoit0123 »

For reference purposes only (because it does not seem to be downloadable), there is also the Applesoft II listing which was a flavor of Microsoft BASIC customized by Apple (for Hires instructions handling) here:
http://www.txbobsc.com/scsc/scdocumentor/
The reader also benefits from wise comments about easter eggs and buried bugs within the code.
This is a constant reference material for people like I who design Applesoft extensions as a hobby.

HTHATS,
Benoît
User avatar
James_Parsons
Posts: 67
Joined: 10 Jul 2013

Re: Getting Microsoft BASIC source

Post by James_Parsons »

Wow, cool Benoit. The Apple II is the only apple product I like :P
JMP $FFD2
Simon
Posts: 155
Joined: 16 Apr 2007
Location: Auckland, New Zealand
Contact:

Re: Getting Microsoft BASIC source

Post by Simon »

I started my version of the code from the pagetable site although I found the way it was presented there hard to follow and I don't know how to use CC65 so couldn't assemble it. In the end I found that Grant Searle on his site had a version all in one file that I found easier to follow: http://searle.hostei.com/grant/6502/Simple6502.html

That version is based on the OSI version of BASIC which is probably the simplest and most closely matched what I wanted to do. I then added my own IO routines to it and after MUCH fiddling got things working: http://www.asciimation.co.nz/bb/2013/10 ... -and-basic

I've progressed a lot since then and now have a fully functioning machine with extended basic, keyboard, video, sound, serial in/out and general IO including an analog joystick port! I just need to make a case for it all. I also found the Apple BASIC listing very useful so I could see how someone else had modified the original MS BASIC to do what they wanted.

Simon
zhen
Posts: 1
Joined: 07 Jan 2021

Re: Getting Microsoft BASIC source

Post by zhen »

I'm not sure what the etticuite is on reviving dead threads, but I found this thread useful.
Grant Searle's version which is unified and cc65 ready was really easy to use, but with 1 problem.
Updated link:
http://searle.x10host.com/6502/Simple6502.html
There is a bug in the ctrl-c handling code which causes LIST/RUN commands to not work.
The ISCNTC always runs into STOP no matter what, so LIST/RUN just simple exits right away.
The original code here: http://www.pagetable.com/?p=46
does not have the bug.
The fix is to simply copy the code from the original source.
Here is a diff:

Code: Select all

diff --git a/Microsoft Basic/osi_bas.s b/Microsoft Basic/osi_bas.s
index 0270d39..59cf91f 100644
--- a/Microsoft Basic/osi_bas.s
+++ b/Microsoft Basic/osi_bas.s
@@ -1289,14 +1289,23 @@ SETDA:
         sta     DATPTR
         sty     DATPTR+1
         rts
+RET2:
+       rts
 ; ----------------------------------------------------------------------------
 ; SEE IF CONTROL-C TYPED
 ; ----------------------------------------------------------------------------

 ISCNTC:
-; MODIFIED CALL BY G.SEARLE FROM THE ORIGINAL OSI CODE
-        jsr     MONISCNTC
-; runs into "STOP"
+        jsr     MONISCNTC
+        nop
+        nop
+        nop
+        nop
+        lsr     a
+        bcc     RET2
+        jsr     GETLN
+        cmp     #$03
+;!!! *used*to* run into "STOP"
 ; ----------------------------------------------------------------------------
 ; "STOP" STATEMENT
 ; ----------------------------------------------------------------------------
Last edited by zhen on Thu Jan 07, 2021 6:29 pm, edited 1 time in total.
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Getting Microsoft BASIC source

Post by BigEd »

(Welcome! Reviving old threads is fine here, when genuinely continuing the same topic.)
User avatar
cbmeeks
Posts: 1254
Joined: 17 Aug 2005
Location: Soddy-Daisy, TN USA
Contact:

Re: Getting Microsoft BASIC source

Post by cbmeeks »

Also, if I could do a little self-promotion, I've put MS BASIC in a 6502 build where it will assemble for various systems like Microtan, OSI, etc.

https://github.com/cbmeeks/6502-Builds

Hope it's helpful.
Cat; the other white meat.
Post Reply