Commodore on Intel Project

You need an actual VIC.

Moderator: Moderators

adric22
Vic 20 Hobbyist
Posts: 143
Joined: Fri Mar 11, 2005 6:54 pm

Commodore on Intel Project

Post by adric22 »

I know this isn't specifically related to the VIC-20, but it seems most of the other Commodore forums I use have died to the point there are no users on them anymore. And I'm trying to drum up some interest in my new project because I really need some help, even if that help is just in the form of advice and discussions.

Here is the website:

http://galaxy22.dyndns.org/admiral64/

I'm pretty much to the point now where I'm trying to write an interpreter for BASIC and it is much tougher than I originally thought. I guess I never really thought too much about how BASIC actually worked deep down inside.

The main issue I'm running into is figuring out how to write code which would be able to process a long line of BASIC code which would have deeply embedded numbers of parenthesis and operands like SIN and ASC and stuff all through it. That is very complex. Right now I'm just shooting for each line of BASIC to have essentially one primary command, plus any arguments that command is expecting. I realize that will be primitive compared to even what a VIC-20 can do, but that is the best my brain has figured out how to accomplish. Of course, even if I can't get any further than that, you could probably still write anything you wanted just that there would be lots of extra lines of code because you would have to spread out the various bits of logic over several lines of code instead of just one big one.
gklinger
Vic 20 Elite
Posts: 2051
Joined: Tue Oct 03, 2006 1:39 am

Re: Commodore on Intel Project

Post by gklinger »

adric22 wrote:I know this isn't specifically related to the VIC-20, but it seems most of the other Commodore forums I use have died to the point there are no users on them anymore.
You have heard of Lemon 64, right?
In the end it will be as if nothing ever happened.
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Someone posted a Commodore Basic for MSDOS port here some time back. Maybe that is something for you to look into. I searched but can't find it right now...
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Found it on my hard drive... The readme file says:

cbmbasic - Commodore BASIC V2 as a scripting language
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(original release, 28 Oct 2008)

This is a 100% compatible version of Commodore's version of Microsoft
BASIC 6502 as found on the Commodore 64. You can use it in interactive
mode or pass a BASIC file as a command line parameter.

This source does not emulate 6502 code; all code is completely native.
On a 1 GHz CPU you get about 1000x speed compared to a 1 MHz 6502.

It has been tested with
* Mac OS X 10.4/10.5 i386/x86_64/ppc (GCC 3.3/4.0)
* Debian Linux Etch (GCC 3.3/4.1)
* Windows NT (Visual Studio 2005/2008)
Other CPUs, operating systems and compilers should work, too.

Windows users should also install
http://www.microsoft.com/downloads/deta ... laylang=en

Feel free to use this project for any purpose, give credit if you like,
and send back improvements to the authors, if you like, so that others can
benefit from it. See source for license details.

Michael Steil, James Abbatiello
http://www.pagetable.com/
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
adric22
Vic 20 Hobbyist
Posts: 143
Joined: Fri Mar 11, 2005 6:54 pm

Post by adric22 »

GKlinger - Yes, I knew of Lemon64 but I haven't been there in years and did not realize they had active forums until you mentioned it and I went and had a look.. Now that I know, I'll go sign up over there.

As for the project mentioned, I am not sure if that is one of the same ones I've already looked at or not. I've actually found two projects with Commodore BASIC but neither of them had a decent screen editor that any way resembles working on a Commodore. Also neither of them has source code compatible with mine. One of them is written in some bizzare language I've never heard of. The other is actually converted from 6502 code using some kind of automated process and it produces a gibberish-like C++ code which only runs in protected mode. I need something that will compile in real-mode and something with a clean source code.. or maybe just some advice as to how to build a compatible BASIC myself.

But anyway, if you have a URL for that BASIC you were talking about,that would be great. I'd like to see what it is all about!
gklinger
Vic 20 Elite
Posts: 2051
Joined: Tue Oct 03, 2006 1:39 am

Post by gklinger »

adric22 wrote:GKlinger - Yes, I knew of Lemon64 but I haven't been there in years and did not realize they had active forums until you mentioned it and I went and had a look.. Now that I know, I'll go sign up over there.
Me and my big mouth.
But anyway, if you have a URL for that BASIC you were talking about,that would be great. I'd like to see what it is all about!
The URL is right there in Boray's post: http://www.pagetable.com/

A search there for "Commoodre" reveals this post which points you at this website. Gotta use your peepers and make a modicum of effort.
In the end it will be as if nothing ever happened.
adric22
Vic 20 Hobbyist
Posts: 143
Joined: Fri Mar 11, 2005 6:54 pm

Post by adric22 »

Me and my big mouth.
And what is that supposed to mean? You assume the people at Lemon64 are going to be irritated by my presence?
The URL is right there in Boray's post: http://www.pagetable.com/
Actually, I looked at that URL and it just appeared to be some kind of news site. I didn't see any reference to what he was talking about, so I assumed was just the signature of the poster, and not related to what they were talking about.

Why is it anytime I run into you on a forum you have to be so negative towards me? I try to be a contributing member of any group I'm in and nobody else seems to be bothered by me except you.
ruud
Vic 20 Devotee
Posts: 245
Joined: Wed Aug 04, 2004 11:26 pm

Re: Commodore on Intel Project

Post by ruud »

Hallo Adric22,

In the beginning I was a bit sceptic because "we have VICE so why another Basic interpreter?". But then I realised that this could be for example a nice tool for children who want to learn to program. Let's be honest, what programming language is easy to learn nowadays? My oldest son (14) is using one of my C64's to learn Basic as first step to learn another language. He prefered the real C64 above VICE :)

So I say: go on with your project!

Code: Select all

    ___
   / __|__
  / /  |_/     Met vriendelijke groet, Ruud Baltissen
  \ \__|_\
   \___|       URL: www.baltissen.org

adric22
Vic 20 Hobbyist
Posts: 143
Joined: Fri Mar 11, 2005 6:54 pm

Re: Commodore on Intel Project

Post by adric22 »

ruud wrote:Hallo Adric22,

In the beginning I was a bit sceptic because "we have VICE so why another Basic interpreter?". But then I realised that this could be for example a nice tool for children who want to learn to program. Let's be honest, what programming language is easy to learn nowadays? My oldest son (14) is using one of my C64's to learn Basic as first step to learn another language. He prefered the real C64 above VICE :)
Thank you! And what is more, the more I learn about how the BASIC interpreter works, I figure out more possibilities. For example, I now believe it would be fairly simple to design it to work on either line numbers, or labels instead. All of the modern versions of BASIC use labels, so that would also help.

And yes.. the pain with learning to program on a modern-day system is the fact that besides knowing a programming language, you have to spend weeks just learning how to use the compiler and other programming tools.

Nothing beats being able to turn on the computer, type a line of code, then type RUN and see it work.
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

Nothing beats being able to turn on the computer, type a line of code, then type RUN and see it work.
I second this one, this is the most missing feature of modern computers.
IsaacKuo
Vic 20 Hobbyist
Posts: 147
Joined: Tue Aug 04, 2009 5:45 am

Post by IsaacKuo »

On a typical modern computer, you can start a command prompt and type in commands. The command line interface is admitedly oriented more toward file system operations and string manipulation than arithmetic, but it's there. You can do a lot with bash scripts.

If you want a good user friendly interpreted language, try out Python. It's a great "starter" language, and it won't teach spaghetti code programming habits that will need to be unlearned later on. You can even develop commercial quality 3d applications, using Panda3d.

If you're mathematically oriented, you may want to try out Octave, an open source alternative to Matlab.

Either way, you can type in code and get instant feedback, and you don't have to deal with a compiler.
ruud
Vic 20 Devotee
Posts: 245
Joined: Wed Aug 04, 2004 11:26 pm

Post by ruud »

IsaacKuo wrote:....Python......... Panda3d......Octave.....Matlab.....
I'm not a newbee. I heard of Python, just heard, never saw it AFAIK. But never heard of the other three. Maybe I'm rusted in the old junk called Pascal and C, in that case I'm indeed to be blamed. But what about kids having no knowledge of any programming language at all, where should they start? Asking around a bit in most cases they end up with people who say: " I used to program Basic/Pascal/C on my C64/PC/Mac. ".

I adviced my son to start with C but he self choose to start with Basic because he liked the C64 that much :)

Code: Select all

    ___
   / __|__
  / /  |_/     Met vriendelijke groet, Ruud Baltissen
  \ \__|_\
   \___|       URL: www.baltissen.org

ruud
Vic 20 Devotee
Posts: 245
Joined: Wed Aug 04, 2004 11:26 pm

Post by ruud »

IsaacKuo wrote:....Python......... Panda3d......Octave.....Matlab.....
I'm not a newbee. ......



Something went wrong and this was posted twice. But even after reading the FAQ I didn't see a button or whatever to delete it.

How?

Code: Select all

    ___
   / __|__
  / /  |_/     Met vriendelijke groet, Ruud Baltissen
  \ \__|_\
   \___|       URL: www.baltissen.org

User avatar
Mike
Herr VC
Posts: 4901
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

ruud wrote:
IsaacKuo wrote:....Python......... Panda3d......Octave.....Matlab.....
I'm not a newbee. ......
Python, and MatLab surely have been around for quite a long time now. But with Octave, and Panda3D I also would say, they're quite new, and thus far didn't earn a large user base.

But ask for a scripting language, and surely there will also pop up Perl-mongers, Ruby-enthusiasts, and - not to forget! - JavaScript.

On the other side, Mathematica, Derive, Maple, RLab.
Maybe I'm rusted in the old junk called Pascal and C
Even though I've also had quite fun with Borlands Turbo Pascal implementation, in school, I quite fast dismissed it as being unfit for bigger projects. And the support of file access is really bad in Pascal.

C still is the swiss-army knife for me. :)

And for learning to write structured programs, C is a better choice than BASIC. There even exists an "interpreted" implementation of C and C++, named Quincy.
Something went wrong and this was posted twice. But even after reading the FAQ I didn't see a button or whatever to delete it.
Only Jeff can delete postings in the General section. Even though I'm a mod, I can't delete my own post here.
Bacon
for breakfast
Posts: 578
Joined: Mon Apr 19, 2004 8:07 am

Post by Bacon »

ruud wrote:I heard of Python, just heard, never saw it AFAIK.
Python is very common these days and it's been around for a long time as Mike said; I think the first version was released in 1991. You've probably used Python programs without realising it. I think it's a good language for a beginner -- almost as easy as BASIC.

Otoh, I really like the idea of having a clone of Commodore BASIC (which of course is Microsoft BASIC really) on a PC. Keep up the good work adric22!
Bacon
-------------------------------------------------------
Das rubbernecken Sichtseeren keepen das cotton-pickenen Hands in die Pockets muss; relaxen und watschen die Blinkenlichten.
Post Reply