FAIL! FAIL! FAIL! FAIL! FAIL! FAIL! FAIL! FAIL! FAIL! FAIL! FAIL! FAIL! FAIL! FAIL! FAIL!
OK, so it’s winter here in Australia, so what is this “Summer Challenge” thing. 2014SC is the Retrochallenge and to quote the site:
“In a nutshell, the RetroChallenge is a loosely disorganised gathering of RetroComputing enthusiasts who collectively do stuff with old computers for a month.
The event is very much open to interpretation… individuals set there own challenges, which can range from programming to multimedia work; hardware restoration to exploring legacy networking… or just plain dicking around. It really doesn’t matter what you do, just so long as you do it.
While the RetroChallenge has its competitive side, it’s not really a contest… it’s more like global thermonuclear war — everyone can play, but nobody really wins.”
This all sounds familiar doesn’t it. Well it is. Last time I attempted this the real world not only got in the way, it knocked me to the ground, and sank the boot in.
So, in recap. . . .
31-July-2014 Update: Best intentions notwithstanding, this was an epic fail.
Barely got started, text command parser incomplete, syntax errors in code still
‘bugging’ me. Going to have to finish this one in my own time, and come up
with a new disaster for the next winter-warm-up comp
. . . so, here is my entry. Back in ’83 I found in an issue of Nibble Magazine, a program called “Nibble Programmer” (click on the image to open the article PDF) that allowed you to write an ‘Applesoft’ program in a text editor, then parse that file to create an actual Applesoft program to run. What’s the big deal you ask? Well, the big deal is that you didn’t use line numbers (remember them?) by referencing Labels, as well as adding extra commands such as While/EndWhile, If/ElseIf/Else/EndIf that reinterpreted as unmodified Applesoft commands. Have a look at THREE-D PIC.txt for an S-Basic program listing I found on the recovered disk image.
I thought “Nibble Programmer” was to long and an awkward a name, so I called my version S-Basic and started adding my own additional commands such as Repeat/Until and graphic drawing commands to plot on the hi-res screen (I wonder what ‘inspired’ these commands?)
This is all very interesting (I hope), but what is the RetroChallange angle in all this? What I’m wanting to do is use the S-Basic 5.3 disk image that I recovered from one of my old and failing 5.25″ floppy disks and use this archival copy of S-Basic from back in ’83 (unmodified) to write a new and hopefully improved version of S-Basic.
I intend to write the parser so that it can be easily extended with new features and functionality, but still render the generated program in plain old Applesoft. No extensions, or add-ons, just plain, ordinary, standard Applesoft code.
The first new function I want to add is long variable names as Applesoft just supports one or two character variable names, and while you could have used longer name, only the first two characters are recognised, so the to string variable names NA$ and NAME$ reference the same value.
The other function I’d like to add is passing arguments to a subroutine. In Applesoft you can use ‘GOSUB 1000’ to jump to line 1000, execute some code, and the ‘RETURN’ statement returns the execution to the line following the GOSUB command. In S-Basic you would use ‘GOSUB LABEL’ and the code to be referenced would be preceded by ‘#LABEL’, but that is only a construct to get around the removal of line numbers.
I want to reference the subroutine within the line as LABEL(value1,value2…), and optionally have a return value on the RETURN command such as RETURN(result), which of course would require, in this case, an assignment such as A=LABEL(value1,value2)
If time permits, I’d also like to provide limited scoping of variables so that any variables explicitly defined within the subroutine are local to the subroutine.
Keep coming back as I post updates on how I’m going (or not). Let the coding begin! (again)