Sunday, August 29, 2010

Baby's First Textbook

Ah, the 1980's. For some it's the age of synth-pop and legwarmers, but for me it opened with entering high school; on the first week we got to choose some after-school activities, and one of the options was a computer, a brand spanking new Apple ][. The school only had to one, and we had to share it by writing programs using mark sense cards very similar to the "Educational Basic" ones shown in that collection, which we'd colour in at home and submit and run during our shot at the machine.

Of course, I "cheated" a little bit; at the time my father ran the immunology lab at Auckland Hospital, and in 1979 they'd purchased a TI-59 calculator (plus the Stats Pack, a small ROM chip) for the lab to use. During my school holidays (and eventually by pressuring my father to bring it home on the weekends) I had learned how to write programs for it. Just simple things to start, but from the Stats Pack especially I learned about things like how to write programs to compute standard deviations and so forth, so I had a good head start on assembly language.

So given the chance to access the Apple ][, I quickly proved myself a determined nuisance to the school's teachers (and probably the other students). Applesoft Basic was not just a great starting point by itself, but it came with one particularly awesome feature:
Particularly helpful for programmers was the foresight to include a simple extension called the “ampersand hook”. If Applesoft came across the “&” symbol while interpreting a line, it jumped to a known location in memory and left it to the programmer to insert the correct code to add a machine language extension to the language. With the publication of important information about the internals of Applesoft in 1980, assembly language programmers were able to add statements to do things that could not be done with the language as it was originally created.

With that, it wasn't just a matter of writing programs in BASIC, but the door was open to the rest of the machine as well: learning the machine language of the 6502 processor and the innards of the machine, which of course was all thoughtfully documented by Apple - the Apple ][ Reference Manual (the second one, not the original Red Book) which contained an assembly listing of Woz's monitor ROM (which had some amazing code and was a great way to learn the ins and outs of the 6502) and a circuit diagram for the motherboard I spent many hours poring over.

Of course, being 13 the other great attraction was games; playing them, and learning to write them in more-or-less equal measure. The games are a topic for another post, learning to write them is an interesting story too. Hires Graphics on the Apple ][ was a strange thing indeed, but at the time I had nothing to compare it to. As there were no built-in graphics primitives, we all had to learn how to write our own, and this lead me to one of the first textbooks I ever bought: Newman and Sproull, Principles of Interactive Computer Graphics, from which I learned the basics of vector math, DDAs and splines and Bezier curves.

Aside from being huge fun, all this had a particularly useful side effect: already knowing a lot of basic statistics from the TI-59 and 3-D math from Newman and Sproull meant that I absolutely demolished the maths parts of all the standardized achievement tests, and as it was the science and maths teachers who looked after the computers for the first couple of years at high school I got to trade writing programs for them after hours (including a scheduling system for the school itself to timetable the classes) for access to the school computer and the other nifty things inside the Maths resource room where it lived: the old textbooks, including the ones I would use to teach myself calculus from.

Here's a link to a site with some great trivia about early versions of Microsoft Basic (including AppleSoft), and another to some information on Steve Wozniak's SWEET-16 system, which at the time I didn't know about as it was part of the original Integer BASIC and not really documented at all.

No comments:

Post a Comment