Get Off My Lawn

Some code I wrote, years ago

Early eighties, to be more precise.

You see, there was Apple DOS (Disk Operating System). And then there were other Disk Operating Systems, faster and therefore better (OK, faster because very often they left out a whole lot of error checking that the Apple DOS performed — but if you have an error there’s not much you can do about it so why check :-)

One of these was Diversi-DOS. It had a splash screen, which of course was stored on the disk, along with display code.

So of course I promptly hacked the splash screen to display my own message. Recently came across a printout from way back then. So here we have some of the first machine code I ever wrote.

086C-   20 2F FB    JSR   $FB2F       JSR $FB2F and $FC58 clears the High-Res and normal text screens.
086F-   20 58 FC    JSR   $FC58
0872-   A0 00       LDY   #$00
0874-   B9 A2 08    LDA   $08A2,Y     Y=0, load from $08A2 (it's down there, 8D 8D 8D etc)
0877-   F0 07       BEQ   $0880       If the value you've loaded is zero, go to $0880 ($00 marks the end)
0879-   20 ED FD    JSR   $FDED       Otherwise print the character ($FDED prints the accumulator A), increment Y
087C-   C8          INY
087D-   4C 74 08    JMP   $0874       And get the next character
0880-   A0 04       LDY   #$04        Now, load Y with 4 and jump to the subroutine at $0895, below.
0882-   20 95 08    JSR   $0895
0885-   C8          INY
0886-   C0 20       CPY   #$20
0888-   D0 F8       BNE   $0882       Then, increment Y and loop, stop when Y reaches $20 (32 -- $ indicates base 16)
088A-   20 95 08    JSR   $0895
088D-   88          DEY               Now do the same thing, but from $20 down to 4.
088E-   C0 04       CPY   #$04
0890-   D0 F8       BNE   $088A
0892-   4C FD 08    JMP   $08FD       And then exit (back to Diversi-DOS)

                                      So here we are with Y=4..31, then 32..5
0895-   98          TYA               Move Y to X via A (because this is how a 6502 works) Second TYA maybe a bug*
0896-   AA          TAX
0897-   98          TYA
0898-   8D 30 C0    STA   $C030       Click the speaker by accessing $C030 (yes, one bit, on or off, no Soundblaster)
089B-   20 A8 FC    JSR   $FCA8       $FCA8 delays for some time dependent on the value in A
089E-   CA          DEX               Now decrement X and loop, i.e. do this as many times as the value in Y
089F-   D0 F6       BNE   $0897
08A1-   60          RTS               And return
08A2-   8D 8D 8D    STA   $8D8D       This is the text that gets displayed by the code up there from $872 to $87E
08A5-   8D 8D 8D    STA   $8D8D       Says "COPIED BY THE DIRTY DEVIL"** in the middle(-ish) of the 40 x 24 screen
08A8-   8D 8D 8D    STA   $8D8D
08AB-   8D 8D 8D    STA   $8D8D
08AE-   A0 A0       LDY   #$A0        $A0 = Spaces
08B0-   A0 A0       LDY   #$A0
08B2-   A0 A0       LDY   #$A0
08B4-   C3          ???               $C3 = C, $CF = O and so on.
08B5-   CF          ???
08B6-   D0 C9       BNE   $0881
08B8-   C5 C4       CMP   $C4
08BA-   A0 C2       LDY   #$C2
08BC-   D9 A0 D4    CMP   $D4A0,Y
08BF-   C8          INY
08C0-   C5 A0       CMP   $A0
08C2-   C4 C9       CPY   $C9
08C4-   D2          ???
08C5-   D4          ???
08C6-   D9 A0 C4    CMP   $C4A0,Y
08C9-   C5 D6       CMP   $D6
08CB-   C9 CC       CMP   #$CC
08CD-   00          BRK

* As I said, the second TYA is not needed, TAX doesn’t change A. But it’s from the earlier code, which didn’t vary the time of each “note”.

** Which is what I called myself waybackwhen.

The result is a sliding note that slows down as it gets lower, then speeds up again. At full volume (erm, there only was one volume) it’s guaranteed to get attention. Of course some guys were much much more into this than I was.

Stay tuned (might take a few years) for when I blog about the digitized voice I once hacked into the Diversi-DOS startup screen… yes, you can recognizably digitize a voice using only one bit.

 

17 year project

Today, seventeen years ago, we re-entered South Africa from Lesotho as part of the 50th Anniversary Tour of South Africa. All through 1996/1997 I’d been frantically putting a Land-Rover together, with much accelerated effort towards the end (if it wasn’t for the last moment I’d never get anything done).

With help from my brother, we ended up getting the Rand-Lover through roadworthy at the end of February 1998, and Elmari and I left on the trip on the 6th of March. It was a bit… frantic.

Since then, this mysterious package has been kicking ’round the back of the Rand-Lover.

Look, it’s wrapped in period-authentic newspaper.

But what can it be?

Look! It’s the trim…

…that goes on the back doors, here.

The intention was to fit these somewhere on the trip. A lot of things did get fitted, but the trim did not make the list.

Yesterday, Eskom blessed us with some more electricity rationing. There’s a round ‘tuit for me! Yay!

I used these captive nuts and M5 machine screws.

And there you go (actually it was a lot more finicky than it looks).

The colour mismatch is 17 years’ worth of fade on the door. Not too bad, actually.

I decided to leave the nearside door for another 17 yea… nah, kidding, I did both.

 

A sad day at the de Waal-Hubbard-Blake household

We have at least one copy of everything Sir Pterry ever wrote. At least one, because both Tanya and I were fans long before we met, and the libraries merged.

I discovered Discworld when The Colour of Magic hit paperback, back in ’85 or so. Been hooked since. Re-read the whole thing recently, it’s so obvious that while the author really wants to write parody, the Discworld keeps forcing him back into Being Serious.  And that’s the thing. While Discworld is light-hearted, the issues are serious. You can read right over all of that without skipping a beat, or you can take your time and realise that real issues are being addressed.

*Sigh* I guess we sort of expected him to be Cohen the Barbarian, so adept at surviving that nothing can kill him.

Alas.

Old friends, now obsolete

Ah yes, New Years’ resolutions. Gotta love ’em.

However, I have too much stuff. There. I said it. I mean, I firmly believe in the William Morris quote,  however, times have changed.

This collection of Elektor magazines I grew up with — obsolete.
A collection of GE Ham News that someone spent money on to have nicely bound — obsolete.

Byte magazines? Obsolete.

Creative Computing? Not quite yet obsolete.

And even if I can’t find it online, scanning and dumping* is better than storing the originals until my container is auctioned off one day.

Don’t get me wrong — I’m still keeping mountains of stuff. Just not… this stuff.

 

* Yes, Jason doesn’t like dumping. I’m not dumping anything that’s even slightly rare, so chill.

Boat Anchor

Well, almost. In Ham Speak, a boat anchor is an old, large, probably obsolete piece of radio equipment. I have more than one.

However:

The Heathkit HW-32 only qualifies if you have a tiny boat. At about 30cm wide and 15cm high, it’s actually quite small for a 14 valve transceiver rated for 200W PEP output. OK, it only does this on a single band, 20m in this case (the HW-12 and HW-22 covers 80m and 40m respectively).

Frequency coverage is 14.2 to 14.35 MHz, for mobile SSB operation. There’s no provision for CW and no coverage of the CW portion of the band.

At 5 1/2 kilos, it’s also too light to be a boat anchor — but that’s because it doesn’t have a built-in power supply. You need to supply 800V DC, 250V DC, and -130V DC bias, as well as 12V for the filaments.

We’ve come a long long way in 50 years.

 

The Sixth Stage of Grief Is Retro-computing

Moore’s law, the speed at which technology moves forward, means that the digital past gets smaller every year. So this is what is left are the tracings of hundreds of people, or thousands, who, 20, 30, 40 years ago found each other and decided to fabricate all this…digital stuff. Glittering ephemera. They left these markings and moved on.

Who wouldn’t want to go back 20 years—to drive again into the office, to sit before the whiteboard in a beanbag chair, in a place of warmth and clarity, and give it another try?

Go read.

NIGHTMARE #6

One of the disks that came with my Apple ][ clone contained a little game called Nightmare #6. At the time it completely stumped me, there seemed to be no way to beat the game. I’d worked out that a move consisted of two letters, no more, no less, and that it was possible to lose points quite quickly, and also possible to not lose points, but I never worked out how to actually gain points.

For some reason I thought of this game again the other day, tried to find it. This was not easy, but plenty google later I found it in the Apple Software Bank Volume 1.

Of course my BASIC is better than it was in 1980. I learned that:

  • You get eleven moves
  • Each move consists of two letters
  • Using the same letter twice gives you a “nightmare #6”, which doubles the amount of points you lose on the next wrong move
  • Re-using the first letter of a previous move gives you “super zonk”, which quadruples the amount of points you lose on the next wrong move
  • Any other move gives you no points, except when the value of the two letters (A = 1, Z = 26) add up to a multiple of ten.
  • If the letters add up to a multiple of ten, you score that value, and the score associated with the second letter is set to this same value.

So, NZ (14 + 26 = 40) is a valid move. So is OY, PX, QW, RV and SU. After playing these, you can’t re-use N, O, P, Q, R or S, but U, V, W, X, Y and Z are all set to 40, so UV, WX and YZ are legal moves for 80 points each, and leaves V, X and Z set to 80.  VZ and XZ give you 160 points each, finishing the game with 1880 points out of a (claimed) possible 2080 points.

So I thought about it some more. Realised that while NZ is a good place to start, XZ (24 + 26 = 50) is better. Of course this means that PX is no longer a legal move, you can’t play the first letter again. OY, QW, RV and SU are still good for 40 points each, and YZ, WZ, VZ and UZ give 90, 130, 170 and 210 points (because the point value of Z increases every time). But this is only nine turns, and we need eleven. Fortunately we still have J (= 10) and T (= 20) to play TZ and JZ, for a total score of 2280 points.

I still don’t know how the author got to the “possible 2080” points.

Screen capture of end of Nightmare #6, with 2280 out of a possible 2080 points.

 

Oh yes, and this is why I’m with Jason Scott — we’re not huge Wikipedia fans because they delete perfectly good information.  Someone took the trouble to write something about Nightmare #6, and noted that it is possible to get more than 2080 points, but the editors decided that “WP is not a videogame guide“.