November 2005 Archives
I created a new logo for the main page of this site: www.dribin.org. It was made with The Print Shop. The real Apple ][ one. On my Mac. How? Emulation. I used an Apple ][ emulator called Virtual ][ (WARNING: that link plays some really obnoxious music!). Aside from the music that plays on the site (did I mention it was obnoxious), it's an awesome emulator. Sound and video work nearly flawlessly, so you can play all the old games. It even has cool disk noises, so it sounds like a real Apple ][ disk drive. I don't know if the noises are somehow linked to disk drive commands, but it certainly sounds more than just random disk noises. It sounds just like I remember. Then, to top it all if, it emulates a dot matrix printer. And anything you "print", can be saved as a PDF.
So, to create the logo, I ran The Print Shop in Virtual ][, and "printed" it out to a PDF. I then converted the PDF to a PNG, using Apple's Preview. And, finally, I created an HTML image map using The Gimp. It's worth pointing out the detail in the original PDF. If you zoom in (or print it out on a laser printer), you'll notice that there are nice horizontal line artifacts to make it look like it came off a real dot matrix printer. Here's a close up:

That's just a nice detail. It is a commercial app, but it's by far the best Apple ][ emulator I've used on any platform. So for me, it was worth the price. Now, I must get back to my game of Montezuma's Revenge.
"What's your favorite assembly instruction?" No, that's not a successful pickup line. This is, however, the kind of things I talk about with my friends. And, yes, I am a nerd. About a month ago, this topic of discussion came up. Of course, the PowerPC EIEIO came up. EIEIE stands for Enforce In-Order Execution of I/O, and is actually a necessary instruction when writing things that depend on the order of values written to memory, like device drivers.
My favorite is the BFFFO (which I pronounce BOO-foh) instruction from the Motorola 68000 family. It stands for Find First One in Bit Field. The definitive reference is the 68000 Reference manual (PDF), page 142 (or 4-42 depending on how you view it). Here's the first line from the description:
Back in my kernel hacking days when I worked at Motorola, this instruction was quite useful in our operating system. We had our own, custom embedded operating system, and I was on the OS team. It was quite an advanced embedded OS at the time, with full memory protection and preemptive multitasking. There were 32 process priorities, and the highest priority process always ran. Within a priority, it was round-robin scheduling. Our implementation naturally consisted of 32 linked lists, one for each priority. During a context switch, we had to determine which process to run next, which means first we had to determine which linked list to look at. Since context switches are generally time critical, it should be efficient as possible. And this is where BFFFO came in. We used one byte (32 bits) as a bit field, where each bit represented a priority level. A 1 meant the priority had at least one ready process, and the linked list was non-empty. Thus we could now use BFFFO to figure out which linked list to use, all in one assembly instruction. While this, of course, is efficient on the 680x0, it posed a problem when porting. I had to write a C version of it, at least once (yes, I had to do it more than once... twice, I think).
I haven't done much assembly hacking as of late, which is both a blessing and a little unfortunate. But as Wolf says, Don't Fear the Assembler.
