Writing Tight 6502 Series Machine Code

This article appeared in the final issue of Twin Cities 128/64, published by Parsec, Inc. of Salem, Mass., sometime after April 1994. Parsec never paid for the article, so under the terms of Parsec’s contract, all rights reverted back to me 30 days after Parsec failed to remit payment.

So now I’m re-asserting my rights to the article. You’ll find the editing poor–all my semicolons appear to have been replaced by commas, for instance–and the writing full of cliches. But I would have been 16 or 17 when I wrote it, and I don’t think it’s a bad effort for a 17-year-old. And the article had some pretty clever tricks. I have to admit I’d forgotten 90% of what was in the article, but I recognize my own writing when I see it.

I’d like to thank Mark R. Brown, former managing editor of INFO magazine, for finding the article and bringing it to my attention. And one final word: Although I wrote this with the Commodore 128 in mind, the same tricks apply to any computer or console based on a 6502 or derivative.

Read more

Windows, ARM, emulation, misconceptions and misremembered history

I keep reading stuff about Windows and ARM and, well, I think people just aren’t remembering history.

I’m not saying that Windows 8 on ARM will save the world, or even change it substantially. It probably won’t, since Microsoft tends not to get things right the first time. But will I automatically write off the project? No. It could prove useful for something other than what it was originally intended. That happens a lot.

But I’m more interested in clearing up the misinformation than in trying to predict the future.
Read more

Reactions to Allen’s memoir. And my reactions to them.

I hate April Fool’s Day. So nobody thinks this is an April Fool’s joke, I’ll just write more about what I wrote about yesterday, concentrating on media reactions to Paul Allen’s memoir. Then, tomorrow, I’ll revisit a very serious, important topic. Read more

So why didn’t Commodore make the Commodore 128 differently?

I grew up on the Commodore 128. We got one for Christmas 1985 (an upgrade from a Commodore 64). It was a bit of a quirky machine, but I liked it.

On the retro computing forums, it might be the most controversial thing Commodore ever did. Which says something, seeing as some computer historians have summed up Commodore’s history in four words: Irving Gould‘s stock scam. But that’s another story.

The cool thing about Commodore was that its engineers weren’t shy about talking about their projects. Bil Herd, Fred Bowen, and Dave Haynie have all weighed in over the years, talking about what they did and why and what they would have done differently.

Read more

Was California Republican Tony Krvaric Strider of Fairlight?

A story today about the possibility that a prominent California Republican, Tony Krvaric, was once a co-founder of the Commodore 64 warez group Fairlight caused an uproar on Slashdot today. The claim said Krvaric went by the handle of Strider.

Reading it brought back some memories.

Read more

Commodore’s founder comes out of hiding

Commodore’s founder comes out of hiding

It’s been said that Ed Roberts of Altair fame was the last person to get the better of Bill Gates in a business deal.

But I’ll say it was Jack Tramiel.

Read more

The little-known story of Commodore

So I’m reading On The Edge, a longish book that tries to tell the story of Commodore properly, including the people who made it happen, and the companies it bought along the way.

I’m glad the story got told.

Read more

Intel inside the Mac–no more question mark

OK, it’s official. Intel has conquered one of the last holdouts: Soon you’ll be able to buy a Pentium-powered Mac.

Of course there are lots of questions now.First of all, Apple having problems with its CPU suppliers is nothing new. Apple’s first CPU supplier was a small firm called MOS Technology. You’ve probably never heard of it, but MOS was a subsidiary of a company you may have heard of: Commodore. Commodore, of course, was one of two other companies to release a ready-built home computer about the same time Apple did. The problem was that the Commodore and Apple computers had the same CPU. Commodore, of course, could undercut Apple’s price. And it did. Commodore president Jack Tramiel was an Auschwitz survivor, and Tramiel pretty much assumed his competitors were going to treat him the same way the Nazis did, so he never cut them any breaks either. At least not intentionally.

When other companies released licensed versions of MOS’ 6502 processor, Apple was the biggest customer. Rumor had it that Commodore was hoarding 6502s.

When Motorola released its legendary 68000 CPU, Apple was one of the first companies to sign up, and the first two commercially successful computers to use the m68K were made by Apple. And life was good. Apple wasn’t Motorola’s only customer but it was one of the biggest. Life was good for the better part of a decade, when Intel finally managed to out-muscle the performance of the Motorola 68040. So Apple conspired with Motorola and IBM to come up with something better, and the result was the PowerPC. And life was good again. The PowerPC wasn’t the best chip on the market, but of the two architectures that you could buy at every strip mall on the continent, it was clearly the better of the two.

Over time Apple’s relationship with Motorola cooled, and the relationship with IBM was off again and on again. Intel meanwhile kept trotting out bigger and bigger sledgehammers, and by brute force alone was able to out-muscle the PowerPC. Steve Jobs got creative, but eventually he just ran out of tricks. Switching to Intel in 2006 may or may not be the best option, but it’s just as easy to do now as it’s ever going to be.

So, now there’s the question of whether this will hurt Microsoft or Linux or both. The answer is yes. The real question isn’t whether it will hurt, but how much. As soon as Microsoft loses one sale, it’s hurt. The same goes for Red Hat.

To me, the question hinges on how attached Apple is to its hardware business. Steve Jobs has only said that OS X has been running on Intel in the labs for years. I have never heard him mention whether the hardware was a standard PC clone motherboard, or something of Apple’s design. I suspect he’s avoiding the question.

It would be possible to make OS X run on Apple hardware and only Apple hardware, even if the CPU is a standard Pentium 4 just like Dell uses. And at least at the outset, I expect Apple will do that. Apple may only have 3-5 percent of the market, but it’s 3-5 percent of a really big pie. The company is profitable.

It would also be possible to let Windows run on this hardware. That may be a good idea. Apple still has something to offer that nobody else does: The slick, easy to use and stable OS X, but on top of that, you can boot into Windows to play games or whatever. It makes Apple hardware worth paying a premium to get.

If Apple chooses to let OS X run on anything and everything, it hurts Linux and Windows more, but it probably hurts Apple too. There’s a lot of hardware out there, and a lot of it isn’t any good. Apple probably doesn’t want that support nightmare.

I think this will narrow the gigahertz gap and, consequently, the speed gap. I think it will help Apple’s marketshare, especially if they allow Windows to run on the hardware. I don’t see it having a devestating effect on any other operating system though. It will hurt marginal PC manufacturers before it hurts software companies.

Cheap hardware won’t stop software piracy

Who’s to blame for rampant software piracy? According to Steve Ballmer, AMD and Intel. Oh, and Dell. Charge less for the computer, and there’ll be more money to pay for Windows and Office.

Steve Ballmer doesn’t know his history.

Read more

We can’t give hackers anything else to work with

Thanks to David Huff for pointing this link out to me (the good Dr. Keyboard also passed it along). Steve Gibson was hacked last month, and he wasn’t very happy about it. So he set out to learn everything he could about l337 h4x0rs (elite hacker wannabes–script kiddies). What he found out bothers me a lot.
Kids these days. Let me tell you…

In my day, 13-year-old truants (those who had computers and modems) used their modems to dial 800 numbers over and over again long into the night, looking for internal-use-only numbers. Armed with a list, they then dialed every possible keycode combination looking for PINs. Then they’d use that information to call long-distance on the telco’s dime. They’d call BBSs, where they’d swap the previous night’s findings for more codez, cardz (credit card numbers), warez (pirated software), or porn.

I never did those things but I knew a lot of people who did. They’d drop off the face of the earth on a moment’s notice, and rumors would go around about FBI busts, computer equipment being confiscated, kids being hauled off to juvenile detention center… And some of them never came back. Some of them cleaned up. Others, who knows? I heard a rumor about one of them running away to Las Vegas after he got out. And some just got hold of their old contacts and went right back to business. One of my friends cleaned up–the huge phone bill he got was enough of a reality check that he stopped. Whether it was a moral reason or just fear of getting caught again, I don’t know. I knew another who got busted repeatedly, and he’d call me up and brag about how his line was tapped, throwing in the occasional snide remark to whoever else might have been listening. I remember our last conversation. He sent me some code (all of the guys I knew were at least semi-competent 6502 assembly language programmers) and we talked music. I’d been fascinated by that subculture, though I never did anything myself–I just talked to these guys (partly out of fear of getting caught, partly because I did want to have some semblence of a life, partly because I didn’t want to kiss up to a bunch of losers until I’d managed to prove I was elite enough), but at that point I was 16, I’d published once, and I realized as the conversation ended that my fascination with it was ending also. It was 1991. The scene was dying. No, it was dead and pathetic. These “elites” had become the butt of jokes–they were risking arrest so they could call Finland for free and pirate Grover’s Magic Numbers, for Pete’s sake! I guess I was growing up. And I never talked to him again. (I don’t even remember this guy’s real first name anymore–only his handle.)

I guess if I’m going to be totally honest, the only thing that’s really changed are the stakes. I want to say my generation wasn’t that bad… But I don’t know.

Essentially, some guy going by “Wicked” had zombies running on 474 Windows PCs. Some of “Wicked’s” buddies took issue with Gibson talking about script kiddies–they thought he was talking about them–so they told “Wicked” to take him down. And he did. And he bragged about it.


"we will just keep comin at you, u cant stop us 'script kiddies' because we are
better than you, plain and simple."

Now, when someone annoys me, I find out what I can about the guy. At 26, I do it to try to get some understanding. At 13 I didn’t necessarily have that motivation, but I did at least have some basic respect. And anyone claiming to be better than Steve Gibson… Gimme a break! That’s like walking up to Michael Jordan and saying you’re better on the basketball court, or walking up to Mark McGwire and saying you can hit a baseball further, or walking up to Colin Powell and telling him you can beat him in a war. And anyone who’s ever written a line of assembly language code and read any of Steve Gibson’s stuff knows it. And it’s not like the guy’s exactly living in obscurity.

Well, Gibson was diplomatic with this punk. And his reasoning and his respect softened him. He called the attacks off. Then they suddenly started again, and Gibson got this message:


is there another way i can reach you that is secure, (i just ddosed you, i aint stupid, im betting first chance ud tracert me and call fbi) you seem like an interesting person to talk to

Say what? You want to talk to someone, so you blow away every other line of communication and ask if you can talk? Now I can just picture this punk once he gets up the nerve to go talk to a girl. He knocks on the door, and the first words out of his mouth are, “I just tesla coiled your phone line so you couldn’t call the cops, but…” Then he’d toss some Kmart pickup line every girl’s heard a million times her way, and hopefully she’d smack him and run to the neighbors’ and call the cops.

For some reason people get hacked off when you do something malicious to them.

Well, Gibson reverse-engineered some Windows zombies and followed them into a l33t IRC channel where he had another interesting conversation. I won’t spoil the rest of it.

Now, I admit when I was 13, I was a mess. I was insecure, and I had trouble adjusting. My voice was cracking, my skin was oily, and I was clumsy and gawky. And I didn’t like anyone I knew when I was 13, because I was the class punching bag. Part of it was probably because I was an outsider. This was a small town, and I wasn’t born there, which was a strike against me. If you got all your schooling there you were still OK. I came in the third grade, so strike two. And I didn’t want to be a hick, so strike three. I liked computers, and in 1987 that was anything but cool, especially in a small town. And everyone thought I was gay, because I didn’t hit on girls and I didn’t have a huge porn collection–and there aren’t many worse things to be in southern Missouri, because it’s still a really bigoted place (and since girls made me stammer, it’s not like I could have proven I was straight anyway). And I had goals in life besides getting the two or three prettiest girls in the class in bed. (Yes, this was 7th grade.) So I guess I was oh-for-two with two big strikeouts. And since I was five feet tall and about 90 pounds, if that (I’m 5’9″, 140 now, and I was scrawnier then than I am now) I couldn’t exactly defend myself either. So I was an easy target with nothing to like about me.

I guess “Wicked” sees Steve Gibson as a five-foot, 90-pound outsider with a really big mouth, so he’s gonna go pick on him. Then he’s gonna go hit on the 13-year-old girl who looks 18, and he thinks taking down grc.com is going to make her swoon and tell him to take her to bed and lose her forever. But since she has a life, she doesn’t give a rat’s ass about whether grc.com is up or down, so hopefully she’ll smack him but I doubt it.

Yeah, I want to say the solution is to make things like they were in 1987 but bullies are bullies, whether it’s 2001 or 1987 or 1967. AD or BC, for that matter.

I want to say that accountability to a higher being will solve everything and make kids behave, but I know it won’t. That grade-school experience I just described to you, with 13-year-olds making South Park look tame and trying to get in girls’ pants? You know where that happened? A Lutheran grade school. Introducing the kids to God won’t fix it. Establishing a theocracy won’t fix it. In college I wrote a half-serious editorial, after a pair of 6-year-olds in Chicago murdered a four-year-old by dropping him out of a 20th-story window after he refused to steal candy for them, where I advocated the death penalty for all ages–maybe then parents would keep an eye on their kids, I reasoned. But I know that won’t fix anything either.

Steve Gibson doesn’t offer any answers. He’s not a social engineer. He’s a programmer–probably the best and most socially responsible programmer alive right now. And what Gibson wants is for Microsoft to cripple the TCP/IP code in Windows XP, so the zombies these script kiddies use don’t gain the ability to spoof come October.

Frankly, I wish such a castrated TCP/IP stack, with raw sockets capability removed, were available for Linux. My Linux boxes are a minimal threat, being behind a firewall and only having a single port exposed, but I’d cripple them just to limit their usefulness to a script kiddie just in case.

Why? Screw standards compliance. The standard for mail servers used to be to allow them to be wide open so anyone could use one, just in case their mail server was down. It was all about being a good neighbor. Then spammers trampled that good faith, so open relays are now the exception, not the rule.

Maybe there’s some legitimate use for raw sockets. I don’t know. But I know nothing I use needs them. So why can’t I run a stripped-down TCP/IP on all my boxes, so that in the event that I do get compromised, my PCs’ usefulness is limited?

If software companies want to provide a full, standards-compliant, exploitable TCP/IP stack for esotetic purposes that need them, fine. Do it. But don’t install it by default. Make it a conscious decision on the part of the systems administrator.

Let’s just get one myth out of the way. The Internet isn’t going to change the world. So when the world does stupid things, the Internet’s just going to have to change instead.