• Please review our updated Terms and Rules here

Looking for source code of any BASIC for CP/M-86

Ruud

Veteran Member
Joined
Nov 30, 2009
Messages
1,390
Location
Heerlen, NL
I think the subject says it all. I need it for a personal project. Many thanks in advance!
 
Try the following site. It has lots of software for CPM/80, 86 & 68. including some Basic.

Digital Research Binary Files

oops, I missed that you were looking for Source Code.

73
Bill WD9EQD
Smithville, NJ
 
Last edited:
What x86 part of the BASIC are you looking for vs porting a CP/M 80 version and starting there?

It shouldn't be that hard to port an 8080 basic to x86, and dedicate a full segment to "BASIC" workspace RAM (thus giving your BASIC programs access to most of the 64K). Even GW-BASIC only had a program heap of ~60+K.

That said, there IS the source code for GW-BASIC: https://github.com/microsoft/GW-BASIC

Obviously it's an MS-DOS BASIC, but it is x86. It might be easier to port to CPM than an 8-BIt version. You can elide the MS-DOS/PC specific graphic primitives.
 
One common complaint about the GWBASIC source is the assembly code is in places… peculiar, because Microsoft used a proprietary “code translation“ system in-house to help with shovelware-ing some of their software between platforms. Because of this there might actually be some spooky resemblances between its source and what you’d have to work with if you started with a Microsoft 8080 version of BASIC and ran that through a source translation.
 
One common complaint about the GWBASIC source is the assembly code is in places… peculiar,
My question has in fact nothing to do with CP/M-86: I'm looking for the Floating Point routines used in this BASIC. I have the sources of GWBASIC (Github MASM 5.1 and original version) and the URC library (undocumented DOS). Both are written MASM and certainly the GWBASIC ones are hard to understand. I translated the URC ones to NASM but as the result doesn't work, flies into LIMBO to be exactly, it seems I misunderstood one or more parts.
Then I found out that CP/M-86 had his own BASIC and that's why I asked for the sources, just hoping that these could be better understood.

FYI: I already gathered a lot of info and already started coding. The biggest obstacle is the division in FP: dividing multiple words by multiple words.
 
It seems that nobody (including other fora) can help me with these sources so I went to plan C: I am going to use the source files of the BASIC for the Commodore 64 as base for my FP routines. I wrote some ML routines that show the conversion from text to FP and vice versa. Now I have to write the 8088 equivalents, input the same values and if the results are the same then I may assume that the routines are OK. Next step: run the various routines for multiplication, division, log, ln, etc., etc. in the C64 and write and check my 8088 equivalents in the same way.

As this hasn't to do with CP/M anymore, I end this thread. Thanks anyway for at least reading it!

FYI: I will publish the results on my site one day. Curious? Just email me.
 
Hi Ruud,
in an earlier search I had confused Small C with Tiny Basic, so of course the search for Small Basic went nowhere ...

With the correct search term, two things came up, both unfinished projects by the look of them:

One search result is for a thread here in this Forum, talking about Palo Alto Tiny Basic.

The other one is an archived comp.lang.asm.x86 post ... the archive containing Tiny Basic is saved on the Wayback machine, but I've appended it to this post.

Robert
 

Attachments

  • tbasic.zip
    48.6 KB · Views: 3
I've written floating-point packages for a couple of commercial products (e.g. SuperCalc, Pascal/M), but said packages have been decimal floating-point, as the money community for many years did not trust binary floating point. Both of mine were for 8080 and 8086--the 8086 one includes 8087 support.
 
I'm looking for the Floating Point routines used in this BASIC.
That would be mostly in MATH1.ASM and MATH2.ASM of the mentioned GW-BASIC version.

That's not unlike what I've been looking for, which is a 68000 version of MS-BASIC with binary math. I know the original Macintosh version had both, but they're a mess because of code segments, and for some reason the binary and decimal versions have significantly different segment layout, making it hard to do a simple diff of the code.

There's a decimal version for the TRS-80 Model 16 Xenix, but I haven't seen a binary version of the same.

I've tried, but it's quite a Herculean effort to reconcile the two Mac versions and the M16 Xenix version with the two publicly available source versions. (6502 and GW)
 
The other one is an archived comp.lang.asm.x86 post ... the archive containing Tiny Basic is saved on the Wayback machine, but I've appended it to this post.
Hallo Robert,

The problem with Tiny BASIC is that it only supports integers and therefore doesn't support Floating Point.

But thanks anyway for your help.
 
Back
Top