Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Scripting In Commodore BASIC For Windows & Linux

kdawson posted more than 5 years ago | from the nostalgia-isn't-what-it-used-to-be dept.

Programming 213

SomeoneGotMyNick writes "Someone more nostalgic than I am, and with a lot of time on their hands, had created a scripting language based on Commodore BASIC for Mac OS X. They recently finished a version that works on Windows and Linux. You can pass the text of a BASIC program as a parameter to the program. I found it odd that it took 1.8 MB of source code to compile to an interpreter that used to fit in 8K of ROM space. If this ever becomes popular, perhaps we'll see Obfuscated CBM BASIC contests." In a simliar vein, in the comments someone points out what is essentially an open source AmigaOS Classic.

Sorry! There are no comments related to the filter you selected.

TI Basic (2, Interesting)

mfh (56) | more than 5 years ago | (#25633179)

I remember coding four pages from 99er, to make a little box go from one side of the screen to the other and change colors, while playing a midi tune. More serious business was the epic dungeon text adventures!

Now of course this would be nice to have on Linux.

Re:TI Basic (3, Informative)

pilgrim23 (716938) | more than 5 years ago | (#25633303)

plugh! or was it xyzzy? :)
there are several Apple II emulators that allow programming in Apple Basic or even Merlin Assembler (65816) for both Mac and Windows. Sweet16 is the best of OS X (a port of Bernie ][ the Rescue from BeOS; originally on Mac Classic), XGS, KEGS and many others are also out there...

CALL -151

Re:TI Basic (3, Interesting)

jojisan (465449) | more than 5 years ago | (#25633313)

Was that a stock 99-4A or did you have the extended memory cartridge?
I really do miss call sprite...

Re:TI Basic (5, Informative)

mfh (56) | more than 5 years ago | (#25633425)

Was that a stock 99-4A or did you have the extended memory cartridge?

I had the 10 ton silver expansion box! 32k baby!!! It was the BEST! :) With the Speech Synthesizer to boot! Doc Watson makes me cry when I think about how much that thing cost me... right out of pocket too from my paper route!!

This particular code made use of CALL SPRITE, but also had the most advanced calls available. Man that brings back memories...

CALL COLOR, CALL CHAR, CALL SPRITE, CALL PATTERN, CALL MAGNIFY, CALL MOTION, CALL POSITION, CALL LOCATE, CALL DISTANCE, CALL COINC, and CALL DELSPRITE.

The cartridge was Extended Basic, which was totally elite at the time. :P

We were all designing color output, while the poor VIC-20 guys were still monochrome.

I still remember the text adventure, where if you type look up, a piano falls on your head. I think it was called Asylum or something? Man that is going way back to the summer of 1983, if memory serves.

Re:TI Basic (0)

Anonymous Coward | more than 5 years ago | (#25634283)

The VIC-20 had color. Sheesh...

Re:TI Basic (5, Funny)

aardwolf64 (160070) | more than 5 years ago | (#25633477)

I had to get my dad to program the dungeon text adventures, so it wouldn't spoil everything for me. There's just something about typing everything that could happen to you that ruins the game.

Re:TI Basic (1)

f1vlad (1253784) | more than 5 years ago | (#25633663)

I recall doing something similar but more sophisticated, something like Xmas card :) I also recall showing it to my parents and they didn't really understand what I was trying to tell them.

Re:TI Basic (0)

Anonymous Coward | more than 5 years ago | (#25633855)

Sounds like you needed a course on optimization. Four pages on the TI was enough for me to get the main animation and part of the sound for a clone of Tron lightcycles I did. And each lightcycle consisted of 2 bytes(one byte for the front and one byte for the back half of the cycle) and while moving each cycle moved one pixel in whatever direction it was facing, in other words I didn't cheat and make it move 8 pixels since I wanted a smooth animation for the game.

Re:TI Basic (2, Interesting)

digitalhermit (113459) | more than 5 years ago | (#25634265)

I remember a similar demo in the TI/994A Reference Manual. It also had a program to re-define a character to make a little jumping man in an 8x16 grid. One of my first programs was to make a running man move across the screen based on the code in the reference manual.

Re:TI Basic (0)

Anonymous Coward | more than 5 years ago | (#25634963)

Mr. Bojangles!

The important quesiton is... (3, Funny)

Thelasko (1196535) | more than 5 years ago | (#25633231)

When will somebody port Radar Rat Race [wikipedia.org] to Windows or Linux?

Re:The important quesiton is... (2, Informative)

aardwolf64 (160070) | more than 5 years ago | (#25633355)

http://www.zzap64.co.uk/c64/c64emulators.html [zzap64.co.uk]

You're on your own for the actual game, but I promise it's out there. It's only 6k zipped.

Re:The important quesiton is... (4, Funny)

Thelasko (1196535) | more than 5 years ago | (#25633715)

I should have known somebody was going to take that comment seriously. Mention porting a crappy game from 25 years ago, and somebody on Slashdot will do/find it.

Re: Should have known (0)

Anonymous Coward | more than 5 years ago | (#25634377)

The rarer, second definition of "Slashdotted".

Re:The important quesiton is... (1)

lastchance_000 (847415) | more than 5 years ago | (#25633583)

Hey! I still have that, and my VIC-20, in my garage!

Re:The important quesiton is... (1)

TheHawke (237817) | more than 5 years ago | (#25633729)

Oh don't get me started on that one! That and Jupiter Lander, both wasted my time as a youngster until Frogger and GEOS came out.

*Cues Gigglebox* Can't wait for the port!

Re:The important quesiton is... (1)

multipartmixed (163409) | more than 5 years ago | (#25634297)

Okay, who are you, and how did you co-opt my life?

Re:The important quesiton is... (1)

El_Oscuro (1022477) | more than 5 years ago | (#25634773)

sudo apt-get install vice

Download your favorite games from c64.com [c64.com] or thegamearchives.com [thegamearchives.com] .

Added layers (1)

TBoon (1381891) | more than 5 years ago | (#25633261)

I assume most of the code went into translation stuff the C64 did in hardware into something that makes sense to a modern OS. Not that an emulator probably would have taken less space...

Re:Added layers (2, Informative)

LWATCDR (28044) | more than 5 years ago | (#25633331)

Actually I would guess that it could be the multiplatform code that takes up so much space.
I have to hope that they don't support Poke and Peek.
C64 basic doesn't support any of the cool features like Sprites and sound.

Re: Peek & Poke (1)

TaoPhoenix (980487) | more than 5 years ago | (#25634485)

Version 2 might have to. Poke & his little brother Peek were the Bastard Twins of Commodore Basic. The Commodore 128 took some steps into making a usable Basic, but the '64 was completely unusable without them.

Re:Added layers (1)

Forbman (794277) | more than 5 years ago | (#25634527)

well...you could poke and peek sprites... a painful process...

Re:Added layers (0)

Anonymous Coward | more than 5 years ago | (#25635109)

C64 basic doesn't support any of the cool features like Sprites and sound.

well...you could poke and peek sprites... a painful process...

That was his point; the C64's BASIC didn't support those facilities itself; the PEEK and POKE were only being used to access the underlying memory locations for those facilities, which doesn't really count.

READY. (2, Funny)

F-3582 (996772) | more than 5 years ago | (#25633269)

10 FORA=1TO300
20 PRINT"YAY!"
30 NEXT
RUN

Re:READY. (1)

aardwolf64 (160070) | more than 5 years ago | (#25633375)

I much prefer:

10 ? "YAY!YAY!YAY!YAY!YAY!YAY!YAY!"
20 ? "AY!YAY!YAY!YAY!YAY!YAY!YAY!Y"
30 ? "Y!YAY!YAY!YAY!YAY!YAY!YAY!YA"
40 ? "!YAY!YAY!YAY!YAY!YAY!YAY!YAY"
50 GOTO 10

RUN

Re:READY. (1)

F-3582 (996772) | more than 5 years ago | (#25633539)

GOTO is evil, didn't you know?!?

GOTO isn't evil (0)

Anonymous Coward | more than 5 years ago | (#25633655)

GOTO isn't evil, but it is considered harmful [wikipedia.org]

Re:READY. (3, Informative)

Blakey Rat (99501) | more than 5 years ago | (#25634181)

Semi-colon, buddy, tells the C-64 to not append a newline after the string. Feh, NEWB!

You could rewrite that as:

10 PRINT "YAY!";
20 GOTO 20

Re:READY. (2, Funny)

Blakey Rat (99501) | more than 5 years ago | (#25634227)

Oh crap, I typoed the code. I'm the newb!

I can make up for it:

10 FOR X = 1 TO 16
20 PRINT "YAY!";
30 POKE 646,X
40 NEXT X
50 GOTO 10

Now we're cooking with gas.

Re:READY. (1)

Gumbytwo (68015) | more than 5 years ago | (#25634423)

You don't need to say 'NEXT X' since there is only one preceding for loop statement. 'NEXT' will do.

Re:READY. (2, Insightful)

tom17 (659054) | more than 5 years ago | (#25633457)

Surely

10 PRINT "YAY!"
20 GOTO 10

RUN

Re:READY. (1)

dontmakemethink (1186169) | more than 5 years ago | (#25634697)

10 FORA=1TO300
20 PRINT"YAY!"
30 PRINT"*** H@X0RED BY DONTMAKEMETHINK ***"
40 NEXT
RUN

Why it's 1.8MB (5, Insightful)

Anonymous Coward | more than 5 years ago | (#25633273)

It turns out that this is just a disassembly of the interpreter translated into C. The file is so large because it has lots of really long computer-generated symbols.

It's a shame that this is not a reimplementation of BASIC in C.

dom

There's also Freebasic. (5, Informative)

GrpA (691294) | more than 5 years ago | (#25633295)

I guess basic is basic unless it's on a machine you're familiar with... I find Freebasic ( www.freebasic.net ) useful, probably because I came from the same era and did all my programming back then too, although I used a Spectrum and I'd never want to have to use that sort of keyboard again.

Freebasic is a fairly recent compiler that makes pretty neat code and has all the common C calls available to it too as well as being able to process native Qbasic programs (if you migrated from the C64 type basic to the PC later) without many of the limitations and nearly complete compatability.

It also allows cross-scripting between Mac, PC and Linux with the same program which I find useful too.

www.freebasic.net

GrpA.

ps. Basic may not be dead, but you still get funny looks when people see you programming in it. I think some consider it even more ancient and antiquated than cobol (which it's not).

Re:There's also Freebasic. (1)

Samah (729132) | more than 5 years ago | (#25633495)

GORILLAS.BAS [telcontar.net] : Microsoft's only open source game.

Re:There's also Freebasic. (1)

cstdenis (1118589) | more than 5 years ago | (#25633597)

What about Nibbles.bas?

Re:There's also Freebasic. (1)

Samah (729132) | more than 5 years ago | (#25633631)

My bad. :)

Re:There's also Freebasic. (1)

GenP (686381) | more than 5 years ago | (#25634051)

Who did the Reversi/Othello clone?

There is another (1)

Gazzonyx (982402) | more than 5 years ago | (#25633681)

GORILLAS.BAS [telcontar.net] : Microsoft's only open source game.

Lest we forget Allegiance [microsoft.com] ...

Re:There's also Freebasic. (0)

Anonymous Coward | more than 5 years ago | (#25634329)

I'd question whether Basic can be considered a computer language at all.

The commands for much anything beyond PRINT and LET are completely changeable. Each of the myriad versions of Basic have their own dialect and features, particularly for graphics commands.

You could define Basic 'an easy to use language with line numbers'. But then again, not all versions even use line numbers!

Re: Whether Basic can be a language (1)

TaoPhoenix (980487) | more than 5 years ago | (#25634513)

Sure! It's the "English" of 80's Comps. All the way from Oxford King's English to the highly creative mashups like the imported workers in my area speak.

Commodore BASIC (4, Insightful)

hpa (7948) | more than 5 years ago | (#25633305)

I have to say, Commodore BASIC was one of the worst BASIC interpreters available in the "home computer" market. It's pretty clear the C64 was really a game console with a keyboard, so it could be (very successfully, and legitimately so) sold as a computer. If you actually wanted the C64 to do anything interesting, you had the choice of assembly, or BASIC that looked like assembly but ran like crap. As far as I can tell, the C64 BASIC didn't use any of the techniques used by other BASICs from the same era to not run like a total dog.

Don't get me wrong, the C64 was a great machine. It just wasn't a great machine for BASIC programming.

Re:Commodore BASIC (3, Interesting)

decipher_saint (72686) | more than 5 years ago | (#25633421)

Compared to...?

I'm actually quite curious what the differences would be that would make it a bad interpreter.

C64 was my first exposure to programming (I was 8 when I got my hot little hands on it), and not having tried anything else from that particular era of home computing I don't have a yardstick to measure that sort of thing.

So please, tell me more :-)

Re:Commodore BASIC (0)

Anonymous Coward | more than 5 years ago | (#25633629)

Compared to...?

I'm actually quite curious what the differences would be that would make it a bad interpreter.

C64 was my first exposure to programming (I was 8 when I got my hot little hands on it), and not having tried anything else from that particular era of home computing I don't have a yardstick to measure that sort of thing.

So please, tell me more :-)

Let me put it this way... it made the Apple II feel fast.

Re:Commodore BASIC (0)

Still an AC (1390693) | more than 5 years ago | (#25633813)

C'mon this is slashdot, where Commodore bashing is almost a popular past time as M$ bashing!

Re:Commodore BASIC (1)

jeremyp (130771) | more than 5 years ago | (#25635103)

Since Commodore Basic [wikipedia.org] was originally written by Microsoft, that seems almost approriate. However, I learned to program using PET Basic and it didn't seem that bad to me at the time. It least you could do lower case characters with it.

Re:Commodore BASIC (5, Informative)

hpa (7948) | more than 5 years ago | (#25633971)

A few things that made Commodore BASIC slow compared to some of the BASICs of the time:

  1. A lot of parsing was done at runtime, rather than at entry time or program startup time. This meant that a lot of work got done over and over rather than once per execution, and also encouraged practices that made programs hard to read, like omitting comments and whitespace.
  2. No support for integer-only arithmetic.
  3. Very few high-level constructs. This didn't just turn programs into a mess of POKE statements, but frequently meant that a lot of them were needed -- all of which involved two floating-point to integer conversions to set a single byte.

Most BASICs at the time would at least tokenize at entry time, and many even converted programs to P-code for execution. It was still much slower than true assembly, but it wasn't anywhere near as bad as the CBM basic. Similarly, most (but again, not all) BASICs of the time supported integer-only arithmetic at least as an option.

I have to admit to being a bit spoiled at the time, since I first learned to program on the Swedish ABC80 [abc80.org] computer, which had a very fast BASIC interpreter. Its follower, ABC800, even had a decent collection of high-level programming constructs in its BASIC. Too bad neither had acceptable graphics, nor a reasonable price point for home use (they ended up being sold mostly into schools and small offices.)

Re:Commodore BASIC (0)

Anonymous Coward | more than 5 years ago | (#25634729)

I think your memory is at least slightly faulty with regards to the C64.

The basic programs were tokenized at input time, not at runtime. This meant you could use two-character shortcuts for most commands, and some single-character ones like "?" for "print" to save entry time. The reason people left out whitespace was the lack of memory. Similarly, the lack of a P-compiled version of the code was also due to lack of memory.

Also, variables were only unique up to the first two characters (for a given type) so no one bothered giving anything descriptive names so as to avoid inadvertent clashes. i.e. You wouldn't want the variable called "status" to accidentally conflict with something called "strength" - hence the crappy coding style most people ended up using.

There was integer arithmatic. You needed to use '%' variables.

A - A real variable called "A"
A% - An integer variable called "A%"
A$ - A string variable called "A$"
Note that all three are distinct, and could exist at once, with the extra pseudo-hungarian symbol part of the variable name. :-)

You are right about the lack of high level constructs though. There was only one way of doing abstraction; via a "GOSUB" call. There was no support for user-defined functions, and all variables were global.

Most people graduated to machine code. The 6510 was quite a nice cpu. The ROM was also easily modifiable, as it could be mapped to ram and/or alterable jump tables were easily accessable in the zero page.

Re:Commodore BASIC (4, Informative)

BitterOak (537666) | more than 5 years ago | (#25634875)

No support for integer-only arithmetic.

Actually, that isn't true. You could specify integer variables by suffixing them with a percent sign (eg. i%=1). But most people were lazy and omitted the percent sign, so their programs ended up doing a lot of floating point math unnecessarily.

Re:Commodore BASIC (1)

digitalchinky (650880) | more than 5 years ago | (#25634353)

I guess all the poor kids were using the Aquarius from Mattel, or any one of several other competing systems all based on the Zilog Z80 processor. This was the first time I came in contact with anything from "Microsoft"

Re:Commodore BASIC - which variant?? (2, Interesting)

TaoPhoenix (980487) | more than 5 years ago | (#25634589)

Being less talented than your average /.er, Commodore *64* basic reduced me to whimpers at that tender age. I pulled out all the stops and mortgaged my childhood in chores to upgrade to the Commodore 128, and that is basically the best value in an upgrade I'll ever see. Helped by the extra passage of years, on the 128 I made maze programs, a Dodge-The-Mall-Traffic Simulator as a joke, Ethnic dialects of Eliza including the Angry New Yorker, and a few quasi-utilities that were more basic concept exercises. Then I sold it to my neighbor for $100 of munchie cash, thus learning about Exiting the Market.

Re:Commodore BASIC (2, Interesting)

LWATCDR (28044) | more than 5 years ago | (#25633429)

Actually Atari Basic was arguably worse the Basic 2.0.
Atari Basic had totally none standard String handling.
C64 Basic lacked extensions for graphics and sound but other than that it wasn't terrible.

Re:Commodore BASIC (1)

ghjm (8918) | more than 5 years ago | (#25633733)

Is this still going around? It's been 30 years.

Yes, Commodore BASIC was slower than integer BASIC on the Apple ][. That's because Commodore BASIC used all floating point numbers. It was the same speed as Applesoft BASIC, since both of them came from the same Microsoft codebase and ran on the same CPU.

So unless you're comparing Commodore BASIC to Apple Integer BASIC, what are you talking about?

Re:Commodore BASIC (1)

2fuf (993808) | more than 5 years ago | (#25633823)

The Commodore Basic interpreter was made by Microsoft (Bill Gates programmed part of it himself) and licensed to Commodore. To say it's different then the 'other Basics' makes no real sense when you consider that most of the interpreters from that era came from the same source. http://www.pagetable.com/?p=43 [pagetable.com]

Re:Commodore BASIC (1)

topham (32406) | more than 5 years ago | (#25634345)

They were all different.
They were quite similar, but every BASIC was a variant.

Re:Commodore BASIC (1)

nschubach (922175) | more than 5 years ago | (#25633877)

How would that compare to a TRS-80... I grew up on that thing and never touched a C64.

Re:Commodore BASIC (0)

Anonymous Coward | more than 5 years ago | (#25634131)

There were C compilers too. In fact most of the commercial stuff was developed in C and assembly.

Personally I had a lot of fun with BBS's written in BASIC and assembly. I never had a C compiler for it even though I wanted one really bad. I couldn't get into C until my Amiga when I was finally old enough to work a job and get enough money to buy a C compiler (I bought a used copy of SAS/C which I still have the disks for).

Re:Commodore BASIC (1)

radarsat1 (786772) | more than 5 years ago | (#25634273)

I'd agree with you except that my Mom wrote her master's thesis on our C64 when I was 14 or 15. I don't think she could have done it on a Nintendo.
(What was a it called? Speedscript?)

Re: Master's Thesis! (1)

TaoPhoenix (980487) | more than 5 years ago | (#25634683)

Tell Mom she rules. She earns a free play of this song.

http://www.youtube.com/watch?v=Ts96J7HhO28 [youtube.com]
"Hey Hey 16k... she bought it to help with her homework!"

Re:Commodore BASIC (1)

GreatDrok (684119) | more than 5 years ago | (#25634445)

I agree that Commodore BASIC was horrible. I first learned BASIC on a Commodore PET 3008 and it was very limited unless you started POKEing into memory. Sinclair BASIC for the ZX81 (my first computer) wasn't much better. The best BASIC of the era came on the BBC Micro which supported REPEAT UNTIL loops, PROCs and so on so you didn't have to write code full of GOTOs. Oh, and it was easily the fastest machine on the block for years after release despite being based on the 6502 just as the CBM machines were although it did run at 2Mhz instead of 1Mhz of the CBMs. In my neck of the woods, the BBC was what people got if they really wanted a computer and the C64 was what they got if they wanted a games machine.

Re:Commodore BASIC (3, Interesting)

ACMENEWSLLC (940904) | more than 5 years ago | (#25634479)

I learned BASIC on an Apple and then moved to the C16 then to a C128 with C64 embedded. I really enjoyed BASIC on the Commodore platform. I loved POKE and PEEK. The with my Super Snapshot card I could get into a pretty good machine language decompiler. From there I could create programs in the $c000 range, store them to a floppy, and sys them. I loved monitoring the raster ($d018 or somewhere close) and changing it's color when it's at various positions to create screenshots better than what the C64 normally allowed.

I never have got as deep with the x86 platform.

The thing I've found with most emulators is that this trickery just doesn't work right. A lot of it depended on the set Mhz rate of the hardware.

I find it odd as many fanboys of the C64 as there are, why not embed one onto a USB dongle. The other end with a RS232C cord?
    Something like this http://www.vesalia.de/e_c64dtv%5B5732%5D.htm?slc=us [vesalia.de] ported for us programmer types.
   

Vic-20 (1)

AgentPhunk (571249) | more than 5 years ago | (#25634759)

The Vic-20 was the wo-
rst of both worlds,
bad games, crappy basi
c, and only 22 columns
across. Oh yea, and a
300-baud modem and no
disk drive, just casse
tte. Still, INFOCOM h
ad a few good text adv
entures on it.

But Sometimes slow is good (1)

DiegoBravo (324012) | more than 5 years ago | (#25634797)

I agree, it was slow. But sometimes a slow computer forces you to think in better ways to acomplish your tasks, and if you're just learning to program, this can be a good habit (of course, I don't think the 64 is the best platform to learn... got my point)

Sadly, today there is an abuse of "premature optimization is the source of all evils", and young programmers just expect the compiler and the hardware to resolve every performance issue.... well, really they apparently do ignore there can exist performance issues.

For professional developers it also may provide some benefits; for example, sometimes I think the Gnome/gtk/etc developers should be given just 486 machines or at most Pentium II machines to develop and test all their code; I'm sure they could eventually get a decent speed on these systems (they're really smart) and would be a wonder for most people running current Core-2 and the like.

We're used to provide the coders with the top hardware (or the coders auto-provide it) as if that would provide better/faster code... the opposite is the truth.

Why? Just use an emulator (1)

aardwolf64 (160070) | more than 5 years ago | (#25633321)

Why? You can already download a C64 emulator for your chosen platform and use REAL Commodore BASIC.

CBM Basic in itself didn't do much (1, Interesting)

Zarhan (415465) | more than 5 years ago | (#25633351)

If you have any of those old CBM-BASIC listings from 80's computing magazines, it's full of POKE x,y statements (and sometimes the program is just a hex loader with bunch of READ...DATAs). So I'm really not so sure of the value of this experiment.

(One of the longest "commercial" CBM-BASIC programs I remember - that actually used it for lots of things - was Sid Meier's Pirates! [wikipedia.org] . (Haven't tested the newest Remake - I did like Pirates Gold!, the first remake, a lot)

1.8 MB of source for 8K of ROM (4, Interesting)

sucker_muts (776572) | more than 5 years ago | (#25633407)

I found it odd that it took 1.8 MB of source code to compile to an interpreter that used to fit in 8K of ROM space

Don't forget that the commodore cpu was 8 bit and current cpu's are 32 or 64 bit: Most of the commands were 8 bit and their equivalents are bigger nowadays. That explains the 8KB of ROM

And they did not need fancy memory protection stuff, they hacked straight into the hardware. No dll's, so's to use or API's to follow. Even if it is a lot assembly code, there are a lot more bytes in assembly source than in binary executables.

Context, people, context! ;-)

Re:1.8 MB of source for 8K of ROM (0)

Anonymous Coward | more than 5 years ago | (#25634229)

He's comparing source code to the binary output, which is a silly comparison to begin with, but still it has nothing to do with CPU architecture or byte size.

A lot of extra crap is added to many modern executables, but otherwise raw code output should typically be smaller than source, unless there is lots of macro expansion or expansive optimization involved.

I smell a terrible contest.... (2, Interesting)

tjstork (137384) | more than 5 years ago | (#25633447)

Is that, some old assembly hackers ought to be able to whip up a fairly tiny basic interpreter. It should be fun in a way and still easier than in the old days of 6502. You have more registers, some basic string instructions, and outstanding support for floating point. I doubt it could be quite as small though, as, the big thing that would bloat it up would be that instructions themselves in 32 bit. For an easier and almost weekend job of it, you could do it in 64 bit assembly for Linux only. That spares you the need to do COM type of stuff and other weirdness that permeates the Windows API. In Linux, you are just doing normal C calls throughout to the OS and so you could bring up basic file services fairly quickly. A clever coder could probably make the BASIC actually be some sort of assembler with it... there's nothing genuinely fancy about it and the memory management of those guys was fairly primitive.

Re:I smell a terrible contest.... (0)

Anonymous Coward | more than 5 years ago | (#25633803)

>Is that, some old assembly hackers ought to be able to whip up a fairly tiny basic interpreter.

Or any CS undergrad whose program still teaches "computer organization" -- which is most of them.

My class made an assembler for an honors project. (It nearly killed us though).

Point is, Assembly Language isn't a lost art. I don't have much respect for CS programs that don't offer a course based on Henessy and Patterson (MIPS).

Re:I smell a terrible contest.... (0)

Anonymous Coward | more than 5 years ago | (#25634763)

Try this one: http://www.ioccc.org/1990/dds.c

But the real question is.... (5, Insightful)

Simonetta (207550) | more than 5 years ago | (#25633483)

But the real question is....Why would anybody do this?? Port Commodore64 BASIC to a PC?

    I used to have a Commodore64 and learned 6502 Assembler on it. When I got a PC (a 286) I felt nostalgic for the C64 and bought a cheap one. I used it about ten minutes and realized what a mistake it was. Fortunately I was able to sell it right away.

    Never look back. There is is nothing that was written for Commodore 64 that isn't 1000 times better on modern PCs. Nothing. Don't give me any BS about the wonderful SID chip and its KOOL mickey-mouse MOD files. They suck, really. Don't tell me about that fantastic game that you used to play on the C64 and have never been able to recreate the excitement on a PC. It's because you were a kid discovering video-games, not the Commode64.

    Are you going to tell me that you miss spending four minutes to load a 25K file from the excretable 1541 disk drive? Or spending 40 minutes to download a 25K file on a 300 baud modem from a long-distance BBS when you're paying the phone bill? Or the stupid PEEKs and POKEs. Do you miss typing in hundreds of numbers from Compute's Gazette because the program is written in super-fast 6502 1.2MHz machine code?

    The only good thing about the C64 was the keyboard. And once you start talking to your 3GigaHertz PC and having your words appear on the screen as you speak, you don't miss the keyboard. Regardless of how good it is.

    Commodore 64's rule!! But, really they suck. Never look back on trash.

Because it's there (2, Insightful)

Nimey (114278) | more than 5 years ago | (#25633599)

obviously.

Re:But the real question is.... (4, Insightful)

spaceyhackerlady (462530) | more than 5 years ago | (#25633611)

But the real question is....Why would anybody do this?? Port Commodore64 BASIC to a PC?

Three reasons come to mind:

1. Because it's there.

2. Because you can.

3. Because it's cool. :-)

...laura

Re:But the real question is.... (1)

dosius (230542) | more than 5 years ago | (#25633783)

GW-BASIC had everything the C64 BASIC did, and more... I wish there were a truly free GW clone. (inb4 "write it yourself": I tried, my C-fu isn't strong enough.)

-uso.

Re:But the real question is.... (1)

Jesus_666 (702802) | more than 5 years ago | (#25634191)

And C++ does everything GW-Basic does, being Turing-complete.

Re:But the real question is.... (2, Insightful)

Super Jamie (779597) | more than 5 years ago | (#25633769)

I agree that there is nothing wonderful about C64 BASIC, and also wonder why someone would port an awful archaic language to modern PCs, when there are far better BASIC interpreters around already.

However, hardware sound reproduction is something else. SID chips produce a noticeable sound, and sound decks with SIDs built in are worth several thousand dollars and used by many popular recording artists today.

You'll also find the Gameboy has a popular sound production scene associated with it. Look on YouTube for "little gp tracker" or just "gameboy tracker" and you'll see what I mean.

tl;dr - BASIC lame, SID good

Re:But the real question is.... (1)

Zarhan (415465) | more than 5 years ago | (#25633957)

I miss ONE particular game that I don't think anyone has managed to re-create. I'd very much appreciate a new version of PSI-5 Trading co [mobygames.com] . You have your standard Elite-esque "trade stuff between planets A, B & C"-thing go on...but the beef is that you command your spaceship *completely* by just giving your crew orders - and they attempt to execute them. So you become Captain Kirk and just bark orders for your Sulu, Chekov and Scotty. I haven't heard of other such games - I mean, you are *always* expected to grab the joystick. Eve Online might come close but it's still pretty much realtime.

Yes, the Mobygames lists DOS version, but the CGA glory isn't exactly the best release.

Re:But the real question is.... (1)

Hatta (162192) | more than 5 years ago | (#25634743)

Star Trek: The Kobiyashi Alternative is played pretty much as you describe. Star Trek: Bridge Commander is somewhat similar too.

Re:But the real question is.... (2, Informative)

eharvill (991859) | more than 5 years ago | (#25635021)

Yes, the Mobygames lists DOS version, but the CGA glory isn't exactly the best release.

Grab a c64 emulator and play the full color version, as shown from the game box screen shots.

It's the "bare metal" feeling (1, Insightful)

Anonymous Coward | more than 5 years ago | (#25634037)

The only thing really great about the C64 is that it forces you to interact with computers on a very low level. Look at kids growing up with computers today: They have hard disk and networks, and never see a command line shell, let alone a programming language (and probably wonder why the "Save" icon in MS Word is a floppy disk - and why you would "save" anyway).

A computer enthusiast today plays around with photo and music collections, a computer enthusiast back in the day found it exciting to discover new PEEKs and POKEs and actually learnt something about technology.

The retro scene is very important. It reminds us what computers are made from, and that there is more to computing than watching Youtube.

    Michael

*whoosh* (3, Insightful)

frieko (855745) | more than 5 years ago | (#25634041)

Of course this is a useless project! Almost as useless as model airplanes and magic tricks and football and all of the other wonderfully useless things people do to amuse themselves. Don't care for it? Fine, but no need to insult it.

Re:But the real question is.... (1, Informative)

Anonymous Coward | more than 5 years ago | (#25634311)

[quote]Don't give me any BS about the wonderful SID chip and its KOOL mickey-mouse MOD files. They suck, really. [/quote]

That's not fair. Many people like the sound of the SID chip, and there's a lot of interesting music that was written for it.
Writing music for such a chip can also be fun, because you're driven to be creative while working under strict limitations.

Some people like bluegrass, some people like rock, etc. Who am I to tell them that bluegrass/rock/etc "sucks"? So you can't say that SID music sucks just because you don't like it.

You whack off so? (0)

Anonymous Coward | more than 5 years ago | (#25634785)

>But the real question is....Why would anybody do this??

You jerk off in the shower, why do you do that? Because it amuses you?

Why don't you go sob one off in a corner right now?

<whack> <whack> <whack> <cry>Nobody loves me!</cry>

Re: Commodore's in the Mirror (1)

TaoPhoenix (980487) | more than 5 years ago | (#25634809)

I disagree, though it took me a minute to formulate the counter-reason.

No one is going to attempt to run Pixar graphics on this. The point is a form of "Limited Time Machine" in which we can return to portions of the past (here, the language) but abuse modern hardware to get sickening speed increases. Then we just drift back in our memories a little about that program we wrote Back In The Day, but now it eats Crays for breakfast.

As for SID tunes, yea, that hardware implementation has passed its prime, but enter Overclocked Remix. It's the musical ideas of those guys that count, and now they can freshen them up into the best kind of Old-Meets-New mashup. That site still makes a quarter of my work music. http://www.ocremix.org/ [ocremix.org]

Re:But the real question is.... (2, Informative)

lastchance_000 (847415) | more than 5 years ago | (#25634883)

The attraction of the home computer scene of the early 80's wasn't productivity, it was the sheer fucking joy of exploration.

Re:But the real question is.... (0)

Anonymous Coward | more than 5 years ago | (#25635061)

MOD's came later with Amiga via Karsten Obarski in 87 ish. The reason the SID tune stuff etc is good is because those guys coded the tunes in 6502 and crammed it in 4kb usually. Plus they solved the baud rate issues with turbo loading/compression schemes and music during downloads, Mix-E-Load was my fave.

But yes, compared to my PS3 it sucks balls. As for Basic 'Blitz' basic on the Amiga in the early 90s was a pretty cool language.

Re:But the real question is.... (0)

Anonymous Coward | more than 5 years ago | (#25635147)

How the fuck is this 4chan-class ranting troll modded +5, Informative?

You need to go back to 4chan with the rest of your troll friends and stay there.

Almost tempted (4, Funny)

ducomputergeek (595742) | more than 5 years ago | (#25633603)

I have an old book on how to build your own telescope from the 1980's that included how to hook up a C64 and use a joystick to control the telescope's movements all written in C64 Basic. I remember porting it to QBasic circa 1994/5 and using it for a telescope I had to account for planetary motion for photography. (Back before every telescope came with such features).

That would almost be fun...wow I really am a geek....*shudders* I'm going back to my cave now.

Huge source (0)

Anonymous Coward | more than 5 years ago | (#25633637)

I found it odd that it took 1.8 MB of source code to compile to an interpreter that used to fit in 8K of ROM space.

It's not all that odd if the developer is a moron (which apparently this one is).

It's been a long time but... (0)

Anonymous Coward | more than 5 years ago | (#25633777)

10 ? Hello Windows OSX World!
20 GOTO 10

Retrocomputing (2, Funny)

Orion Blastar (457579) | more than 5 years ago | (#25633801)

Now my 25 year old C64 BASIC programs can run under Linux, OSX, or Windows.

If only my 1541 floppies didn't suffer from bit rot and I loaned most of my collection to friends who didn't return them and somehow lost it after they moved.

Another Security Hole (1, Funny)

Nom du Keyboard (633989) | more than 5 years ago | (#25633841)

Just as we do our best to get .vbs files locked down someone comes up with a new scripting language just waiting for exploitation.

I hit L, Shift-O to the Quote and then Dollar! (3, Funny)

JoshDM (741866) | more than 5 years ago | (#25633849)

If you know the dir of the nerdcore rhyme, then holler!

The advantage of BASIC (1)

KalvinB (205500) | more than 5 years ago | (#25633879)

The main advantage to BASIC is that it's trivial to get simple graphics going so you can learn how to make a wide variety of games without having to get overloaded with information about APIs and whatnot. Unfortunatly most games don't have terrible graphics so beginning programmers tend not to be satisified with large solid colored blocks.

It may be worthwhile to come up with a compiler that expands the BASIC commands to include functions which load various graphics formats into sprites and allow you to display them easily. I remember having to use primitive shapes to draw graphics and then GETing the area on the screen and PUTing it. Eventually I developed my own graphics format that used text files that could be edited by hand.

Colors? (0)

Anonymous Coward | more than 5 years ago | (#25633939)

Can I change my Windows background color? Let's try...

10 POKE 53280,0
20 POKE 53281,0
RUN

ERROR OCCURRED.
PLEASE REPORT THIS PROBLEM TO QUANTUM LINK'S CUSTOMER SERVICE.

%)9hlkhd g y4i8
aseg.
dg4yu4i .frj91`2
d;gk
d
gn 73uo24hj rh
!$
y63

+++ATH0
NO CONNECTION

Re: C64 Colors for Life (1)

TaoPhoenix (980487) | more than 5 years ago | (#25634851)

As I type my montor desktop color is C64 Blue on a black monitor.

What about PEEK and POKE? (1)

aswang (92825) | more than 5 years ago | (#25634049)

BASIC 2.0 seems pretty worthless without support for all the PEEKs, POKEs, and SYSs, though. Is there a port of BASIC 7.0? Or at least BASIC 3.5?

Ah, good times! (1)

joetheappleguy (865543) | more than 5 years ago | (#25634201)

5 CLS
10 INPUT "WHAT IS YOUR NAME?"; A$
15 IF A$ = "JOE" THEN GOTO 50
20 PRINT "YOU ARE NOT AS COOL AS JOE, SORRY!"
30 FOR I = 1 TO 10000
35 NEXT I
40 GOTO 5
50 FOR I = 1 TO 20
55 PRINT "JOE IS COOL!"
60 NEXT I
70 FOR I = 1 TO 10000
80 NEXT I


>RUN

That's why I read /. (1)

stm2 (141831) | more than 5 years ago | (#25634885)

scripting + commodore + linux. Who did it? Taht boy in Afghanistan?

Ah sweet memories, I love /. (4, Funny)

Phizzle (1109923) | more than 5 years ago | (#25635085)

I remember coding a nuissance program in 6510 assembler on my C-64 that sat in the background and when a key was pressed it had a tiny chance not to echo it to the screen or to echo it twice. After installing it on several classroom computers off the old 1541 floppy it drove some students batty, they thought they had sticky keys. This was before real viruses :)
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?