News for hackers. Stuff that matters.
Re:40-Year old BASICA utility code for teaching by norton120 on Tuesday May 21, 2024 @09:05AM (#40427974)
These scripts were written by my father in the 1980s, he was a middle school science teacher and wrote these to help him manage classrooms. I think it’s a cool example of the way personal computing changed life in that era; he was never a software engineer, just a guy that needed to automate some tedious work. I encoded the BAS files in utf8 so they are easier to read.
Re:40-Year old BASICA utility code for teaching by tombert on Tuesday May 21, 2024 @03:29PM (#40432752)
A bit tangential, but I had a chemistry teacher in high school (~2007) who I liked a lot, but was not super tech-savy. I was staying after class to get some help with a homework assignment, but we ended up chatting a bit because he was funny and very friendly.

He mentioned how long grades took him to calculate because he had a lot of custom weighting for stuff, and he was doing everything with a Texas Instruments calculator, and he was dreading it because the semester was almost over. I said something like "Couldn't you do this with Excel or something?"

He didn't really know what Excel was, but my dad had like a week before taught me how to use it for basic number crunching stuff, so I loaded it up on his computer, and showed him some very basic arithmetic stuff, and how to use cells as variables and roughly how copying and pasting worked. He was immediately amazed and I left feeling super smart.

The next week, I chatted with him again, and he had completely overtaken my Excel ability. He learned a bunch of little tricks I was unfamiliar with, had redone all of the gradebooks with it, added a lot of conditionals, color coding, and I think might have even been using the VBA. He also added graphs to look at how much he had to curve things and to see if tests were fair. It was life-changing for him; a task that used to take him hours of manual work was reduced to about fifteen minutes of playing copypaste.

Excel is particularly interesting to me, because it's very immediately useful, but you can also go super deep with learning new features, and it keeps getting more useful!

Re:40-Year old BASICA utility code for teaching by glimshe on Wednesday May 22, 2024 @06:15AM (#40439276)
Spreadsheets are one of the best technological advancements in the past 100 years - and I'm not exaggerating. There is just so much you can do with them; they are probably the most accessible way for a human to access the power of CPUs and computation. For most problems, I'd rather use a spreadsheet than a general-purpose programming language, because the spreadsheet itself offers a quick away to leverage data structures and functions.
Re:40-Year old BASICA utility code for teaching by tombert on Wednesday May 22, 2024 @10:37AM (#40441551)
Yep, completely agree. I remember I saw a talk six or seven years ago where they said something to effect of "spreadsheets are the best programming language because they allow people to program without even realizing they're programming", and I agree with that sentiment.

They give you access to a lot of programming logic, they're visual, they're reactive, they're easy to learn, and maybe most importantly, the results are instant. Instead of having to try and understand data types and scope and having to run a program from scratch for every change, you can just change a value and see the result right away.

I use spreadsheets for nearly anything involving "numbers" (outside of stuff with lots and lots of data), because it's a lot less of a headache than setting up a "real" language. They're wonderful.

Re:40-Year old BASICA utility code for teaching by ale42 on Tuesday May 21, 2024 @09:58AM (#40428592)
> Because DOS systems used CP437 encoding it is unlikely any of your editors will even be able to open the .BAS programming files in the Program directory

Actually this is not related to CP437. For normal ASCII text, CP437 and UTF-8 are identical... the problem is that BASICA/GW-BASIC were storing the source code in tokenized binary form, probably to save disk space. See for example this decoding utility: https://github.com/rwtodd/bascat

Re:40-Year old BASICA utility code for teaching by wlindley on Tuesday May 21, 2024 @10:31AM (#40428970)
Heath/Zenith's ZBASIC on the MSDOS-but-not-PCDOS Z-100 used a similar format but with at least different keywords. Somewhere I had a set of programs I had written in ZBASIC but could never load after selling that computer. Wonder if I still have the floppies squirreled away, now that I have a Greaseweazel to read those diskettes...
Re:40-Year old BASICA utility code for teaching by greenbit on Tuesday May 21, 2024 @10:25AM (#40428886)
Wasn't there a way to tell BASIC to save in ASCII, rather than tokenized? Something like sticking ",A" onto the end of the save command? Or maybe I'm thinking of gwbasic ..
Re:40-Year old BASICA utility code for teaching by ale42 on Tuesday May 21, 2024 @10:26AM (#40428907)
Not sure about BASICA, but GWBASIC definitely had this ",A" at the end of the filename to save in text format. It even had a ",P" flag to save in "protected" tokenized format (which you can't "officially" list, although a POKE at the good undocumented place could remove the flag: https://www-user.tu-chemnitz.de/~heha/hsn/chm/gwbasic.chm/to...).
Re:40-Year old BASICA utility code for teaching by livrem on Tuesday May 21, 2024 @01:01PM (#40430976)
That was a fun way to find the address and POKE it. Never knew of any of this, but it inspired me to search for more info, and it looks like there are also easier ways to unprotect files:

https://retrocomputing.stackexchange.com/questions/7104/how-...

https://slions.net/threads/deciphering-gw-basic-basica-prote...

I remember seeing some BASIC games that could not be listed. Found that very frustrating as a kid trying to learn BASIC. Maybe now I can finally get to see something of how those games were made, assuming that at least some games were only protected in this way.

Just opening the file in PC-BASIC seems to be the easiest solution: "PC-BASIC can read and write Protected files created by GW-BASIC. Unlike GW-BASIC, however, it does not disable accessing the unencrypted contents of the file. The encryption used by GW-BASIC has been broken many decades ago, so Protected mode offered little protection anyway; disallowing access is a small security hazard as it would allow someone to send you a program that you cannotinspect before running it."

Re:40-Year old BASICA utility code for teaching by lloydatkinson on Tuesday May 21, 2024 @10:16AM (#40428785)
What a weird Git repo structure. One branch for each language, instead of a directory for each language.
Re:40-Year old BASICA utility code for teaching by hedora on Tuesday May 21, 2024 @10:41AM (#40429119)
I had a colleague that did something similar. It generated a lot of confused “which branch do I check out?” slack messages.
Re:40-Year old BASICA utility code for teaching by lloydatkinson on Tuesday May 21, 2024 @11:31AM (#40429733)
It seems totally at odds with common sense. Now, every time you need to make some change across multiple branches you have to go through a lot of unnecessary pain.
Re:40-Year old BASICA utility code for teaching by throwanem on Tuesday May 21, 2024 @01:26PM (#40431308)
I'm sure, for this historical-interest repository, that that will pose a real problem.
Re:40-Year old BASICA utility code for teaching by lloydatkinson on Thursday May 23, 2024 @04:11AM (#40451937)
Well... yes? What if an another newer or older version of the code is found on a floppy or stack of printed code?
Re:40-Year old BASICA utility code for teaching by throwanem on Monday June 03, 2024 @12:39PM (#40564441)
Worry about it when it happens.

It seems like finding this version took at least half a miracle, so I feel like the potential and probably not too effortful reorganization of the repo to accommodate another is a problem worth leaving to be solved only once it's known to be worth taking the trouble.

For that matter, given manual reconciliation of two versions of very old, not previously version-controlled code would almost certainly be required anyway, the additional friction imposed by this repo structure very likely is net neutral in any case.

Re:40-Year old BASICA utility code for teaching by abdulhaq on Tuesday May 21, 2024 @11:43AM (#40429923)
Probably an ex-subversion user
Re:40-Year old BASICA utility code for teaching by norton120 on Tuesday May 21, 2024 @12:52PM (#40430867)
very cool to learn - I'll update the readme
Re:40-Year old BASICA utility code for teaching by dhosek on Tuesday May 21, 2024 @08:41PM (#40436084)
This was also a feature in Applesoft Basic, where the BASIC keywords were all tokenized to save space (and also speed up execution since the code was pre-tokenized when it was executed).
Re:40-Year old BASICA utility code for teaching by dlachausse on Tuesday May 21, 2024 @11:27AM (#40429678)
GW-BASIC is open source and should presumably be able to run this code with possibly minimal changes.

https://github.com/microsoft/GW-BASIC/

Re:40-Year old BASICA utility code for teaching by tssva on Tuesday May 21, 2024 @12:30PM (#40430597)
It should be able to run them without any changes. GW-BASIC was derived from BASICA and is functionally identical. BASICA required the cassette basic rom which shipped with IBM machines and GW-BASIC did not.
Re:40-Year old BASICA utility code for teaching by fuzzfactor on Thursday May 23, 2024 @01:02AM (#40450644)
A full version of BASICA.EXE is included in the Program folder with the zipped DOS .BAS program files if you download norton120's package.

This BASICA.EXE is the full 79kb GW-Basic 3.22 copyright Microsoft 1983, 1984, 1985, 1986, 1987.

A different version I have been using for decades is 78kb and launches with a different text header: COMPAQ Personal Computer BASIC Version 3.31 copyright Compaq Computer Corp. 1982, 1988. Copyright Microsoft 1983, 1987.

Thought to be equivalent but doesn't say anything about GW-Basic on the Compaq one.

I use it to run a program I wrote decades ago to calculate caustic soda according to reporting standards that were already arcane at the time. And GW-Basic was the "new Basic platform" for the IBM PCs and compatibles that looked like they might be here to stay by about then, and beginning to show up in a number of offices. My code was originally written in 1980 on a Hewlett-Packard gas analyzer designed in the 1970's. Even though caustic has nothing to do with gas commodities I was so fortunate to have a benchtop Basic instrument I could do anything with, and caustic was just calculations.

Once PCs got more powerful and proliferated I waited a few more years before converting caustic code from HP-Basic to IBM-Basic. HP-Basic was two optional ROMs that cost $1500 you plugged into the instrument PCB. Early IBM-Basic was still ROM-based too, this is the one that was launched from DOS using the 4kb BASICA.COM (rather than basica.exe). So it's the basica.com (sometimes renamed to basica.exe !) that doesn't work when you try to run it, because it is really meant for the antique motherboard with the specific ROMs. If you have both basica.com and basica.exe in the same directory on the command line in DOS, and you type in just "BASICA" without the extension it will run the .com if present (and errorfail with Incorrect DOS Version) rather than the full executable.

In the late '80's once it looked like GW-Basic had good penetration, made the final tweaks to my code and ran it under DOS 5, DOS 6. Booted Win3.x and W9x to DOS whenever, and since NT5 just works in a Windows command instance as long as you don't try a 64-bit version of Windows.

Re:40-Year old BASICA utility code for teaching by tssva on Thursday May 23, 2024 @06:47AM (#40453035)
IBM shipped 3 BASIC interpreters with the PC. Cassette Basic, Disk Basic and BASIC Advanced. Cassette BASIC was contained in a 32k ROM. Disk BASIC depended upon cassette basic but added support for floppies and a few other features. It required the cassette basic rom to be present. It was meant for machines with low memory and was launched via basic.com. Once all PCs shipped with more memory by default basic.com became just a launcher for BASICA for batch file compatibility.

BASIC Advanced (BASICA) also required the presence of the cassette BASIC ROM. It added additional features above disk BASIC but required more memory. It was originally launched via basica.com. This eventually changed to basica.exe. At this time basica.com became just a launcher of basica.exe.

Non-IBM versions of MS-DOS, at least the versions targeted for PC clones, shipped with basic.com and basica.com being launchers for basica.exe. This is true at least as far back as Compaq DOS 1.10. Earlier versions of MS-DOS were branded by OEMs and included versions of GW-BASIC which didn’t make direct reference to GW-BASIC such as the Compaq example you gave. I have a Zenith Z-161 luggable in my collection and the Zenith version of MS-DOS it runs has a BASIC which is gw -basic but reports itself Zenith BASIC and simply includes Microsoft in the copyright notice.

Re:40-Year old BASICA utility code for teaching by incanus77 on Tuesday May 21, 2024 @05:39PM (#40434346)
An excellent project that I have used and contributed to is PC-BASIC, a ground-up emulator in Python that is very good:

https://robhagemans.github.io/pcbasic/

Edit: I'm now seeing that the OP project uses PC-BASIC for the Docker mode.

Re:40-Year old BASICA utility code for teaching by dpweb on Tuesday May 21, 2024 @10:30AM (#40428954)
3.5" disks, nice. We were still on 5 1/4" in high school in 87-88.. True floppys! I remember thinking 3.5" hard disk - wow the technology :)
Re:40-Year old BASICA utility code for teaching by hedora on Tuesday May 21, 2024 @10:44AM (#40429156)
We were still using 5 1/4”, but the school CS teacher had a special press that cut a notch into the 360K (?) ones to trick the Apple II’s into using them in 720K mode.

She also had a utility to copy original software disks onto the “high density” disks, then read back the data.

From what I could tell, it worked like a charm. 10% of the copies failed, but whatever.

(Coursework was stored on unmodified disks, of course.)

Re:40-Year old BASICA utility code for teaching by unregistereddev on Tuesday May 21, 2024 @11:53AM (#40430078)
The special press was fancy! I used a hole punch (the type intended for punching small round holes in paper), and as long as you lined it up correctly it worked great.
Re:40-Year old BASICA utility code for teaching by hedora on Tuesday May 21, 2024 @01:56PM (#40431602)
Come to think of it, it was a hole punch.
Re:40-Year old BASICA utility code for teaching by pjmlp on Wednesday May 22, 2024 @08:54AM (#40440347)
I was envious of a friend of mine with a ZX Spectrum +3A, with the builtin drive.

The rest of us had tapes.

And yes the high school computers were running MS-DOS 3.3, with two 5 1/4" drives and no hard disk.

Re:40-Year old BASICA utility code for teaching by lproven on Thursday May 23, 2024 @05:57AM (#40452695)
+3, not +3A.

I suspect you're thinking of the Amstrad Spectrum +2 (grey, largely the same as the Sinclair ZX Spectrum 128) vs Amstrad Spectrum +2A (black, contained a +3 motherboard minus the FDD controller, and less compatible with external peripherals).

Re:40-Year old BASICA utility code for teaching by syx on Tuesday May 21, 2024 @09:50AM (#40428502)
This is fascinating, thank you for preserving this work! Do you have more details on the machine used by your father to develop these utilities? what process did you follow to extract these from the 3.5mm floppy disk?
Re:40-Year old BASICA utility code for teaching by norton120 on Tuesday May 21, 2024 @12:59PM (#40430955)
I know we had a 486 at some point when I was a kid, but this code would have predated that machine by a few years so I'm not entirely sure. There were also machines at the school (where he worked) but not 100% sure what they had when.

I got fortunate with the disks - I just bought a USB 3.5mm reader and hooked it up to my Ubuntu machine, and there the files were, no corruption that I can tell. I'm glad other people are also enjoying the find!

Re:40-Year old BASICA utility code for teaching by chungy on Tuesday May 21, 2024 @02:12PM (#40431800)
It's 3.5 inches, not millimeters :)
Re:40-Year old BASICA utility code for teaching by rsynnott on Wednesday May 22, 2024 @10:19AM (#40441347)
3.5mm floppy disks are, of course, what they used to have instead of micro-SD cards.
Re:40-Year old BASICA utility code for teaching by rlawson on Tuesday May 21, 2024 @09:43AM (#40428414)
How neat! Thanks for sharing. Wish we could get back to everyday people being creators as well as consumers
Re:40-Year old BASICA utility code for teaching by slushy-chivalry on Tuesday May 21, 2024 @12:13PM (#40430379)
Amazing

Now if only the education system improved as well and stopped feeding the kids useless information.

Re:40-Year old BASICA utility code for teaching by fuzzfactor on Wednesday May 22, 2024 @01:55PM (#40443947)
Original programs work as is on bare metal on a UEFI system with CSM enabled.

Using DOS (obtained from W98SE) booted to its own FAT32 filesystem on a HDD, SSD or floppy if you got 'em.

Also works on Windows 10 32-bit if you enable NTVDM,reboot beforehand. In file manager double-click basica.exe in the original 204kb Program folder after unzipping. Doesn't need to be stored on FAT32 for this. Basica.exe doesn't launch from regular W10 command line, but can alternatively be launched using the Run routine from the Start menu though.