Jeff Duntemann's Contrapositive Diary Rotating Header Image

A Chart, If You Can Read It

The last couple of evenings I’ve been working at fulfilling a promise I reneged on ten years ago. Somewhere in the text of the second edition of Assembly Language Step By Step (which I was writing in the summer of 1999) I promised readers an ASCII chart as one of the appendices. I then plum forgot, and the book appeared in 2000 without that appendix. I still get emails from people asking me where they could find the chart, and have to reply in my best sheepish email voice that no chart exists anywhere in the book.

So this time I thought to put things right. I sat down in front of InDesign and figured out an ASCII chart format for the full 256-character extended set, and drew me an ASCII chart. For the encoding I used Code Page 437, which is what they now call the IBM PC ROM character set. Whether they could name it or not, CP437 was much beloved of DOS text-mode programmers, with all four card suits and more box-draw characters than anybody ever knew what to do with. The chart will fit comfortably (if snugly) on a single page in what we in publishing call “computer trim,” and I consider it a complete success, at least if you have good eyesight or a set of readers within easy reach.

Except…

As best I can tell, there is no encoding option available for Konsole (or any other Linux terminal emulator that I have) for Code Page 437. As close as I’ve come is IBM-850, which has fewer box-draw characters and more non-English alphabet glyphs. Of course, once you have a chart, it’s no big deal to find a new set of glyphs and sub them in, which is what I’ll be doing in coming days. In the meantime, if you have any use at all for a CP437 ASCII chart, here it is. I’ll post the one for IBM-850 when I finish it. Ten years late, I guess, but better late than never.

Debuggery

In parallel with editing and (increasingly) writing chapters, I’ve been interviewing tools to feature in later parts of the third edition of Assembly Language Step By Step. Kate has the gig for editor, but the debugger slot has been annoyingly open for a long time. Since the beginning of the year I’ve been interviewing debuggers and GUI debugger front-ends for gdb, which is more an engine than a debugger and may well be the single most painful piece of software I’ve ever had to use. (Don’t get me started on that. Whoops. Too late.)

It’s been frustration cubed. Here are some notes on the fray thus far:

  • Nemiver does not work correctly with assembly language executables.
  • Insight would be a good choice, but it is one of the ugliest things I’ve ever seen running on Linux, and I mean ugly in the sense of, well, ugly: Badly rendered Motif/Lesstif screens that seem scruffier than they should be, with hard-to-read tiny fonts. I know why they used that widget set (it’s very lightweight) but I also think that’s no longer anything like an issue in the Linux world.
  • DDD is uglier than Insight, and doesn’t work as well.
  • KDbg was my favorite for a long time, because it’s not ugly and fairly straightforward to use, but its help system is broke and I never figured out how to dump memory or display named data items from assembly. Like Nemiver, it was really created with C and C++ in mind. Like people tell me endlessly (and shut up, already!) “Nobody uses assembly anymore.” Heh.

As I race past 65,000 words and close in on the end of Chapter 6, I was forced yesterday to make an executive decision and call Insight the winner. Insight is interesting in a number of ways: It’s not a GUI front-end for gdb; it is gdb, and has knowledge of gdb’s deep internals in a way that a separate app simply can’t match. The GUI was written in Tcl/Tk, a language I learned and enjoyed almost fifteen years ago when I got Ousterhout’s book in for review at PC Techniques. One would think it would be no big deal to rewrite Insight for Gtk or Qt, but I don’t see the dust from any stampede.

So I got me an ugly debugger. That is (given my deadlines and the significant amount of money riding on the project) better than no debugger at all.

Looking for Mr. Beefheart

Jeff and QBit With Heart-Shaped Steak02-2009Small.jpgStop looking, actually. He’s right here. (And that’s Mr., not Captain, thanks.) Carol was at a dog show yesterday and I blasted out 4600 new words on Chapter 6, so it was not an especially romantic day, but that’s OK; we have built romance into the very fabric of our lives together, and in a sense we do a low-key, distributed Valentine’s Day 24/7. It’s not a giddy, infatuated romance–though we rediscover a little of that now and then—but rather the steady heat that comes of knowing one another unselfishly and deeply for a great many years. (For us, that would be closing in very quickly on 40.)

So Carol surprised me with a somewhat unusual Valentine’s Day present yesterday: A Colorado rib-eye steak cut in the shape of a heart. The steak came from Ranch Foods Direct, a Colorado Springs packing operation that buys local beef and buffalo and sells it both wholesale and at a couple of their own shops. We buy a lot of their meat, as it’s antibiotic and hormone-free, mostly grass-fed, and doesn’t travel very far to reach us. If you’re local, I do recommend them.

Knuckle-dragging, knob-headed Neanderthal that I am, I’ve been improving my health in recent months by eating less grain and more meat. The caveman diet has raised my general energy level (I don’t remember the last time I wrote 4600 words in one day!) and dropped my weight to 148, from 155 a year ago. I’d eat less sugar too, except that I haven’t eaten significant quantities of sugar in years. (I have dessert about three or four times a month, and then only after a big meal.)

Once Carol unveiled the steak, QBit couldn’t keep his eyes off it, and he followed me around the house as I looked for a suitable place for the inevitable photo opportunity. The weather should be good tomorrow. It may get up to 50, and be sunny, and we’re going to grill it out on the back deck. QBit and Aero will both get a little bit. Neanderthals had dogs, and still do. Neanderthals didn’t write computer books—and their dogs weighed a little more than fifteen pounds—but Tuesday was Darwin’s birthday. Here’s to evolution!

KDE Follies

I’ve been busy. And I’ve had headaches. This is mostly why you haven’t heard from me in a few days. I wondered for awhile if I was getting headaches because I was busy, but I’m coming around to a different point of view: I’m having headaches because I’ve been fooling with KDE.

I used to like KDE, until KDE 4 happened. Kubuntu 8.04 would not install correctly on two of the three machines I tried it on, and on the third it malfunctioned weirdly after a couple of days of very light use. I had almost no trouble with Kubuntu 7.10, apart from its failing to set up a network printer. That was KDE 3.5, which I liked. The press on KDE 4 was not good, and I figured I would let Kubuntu rest for a couple of cycles to see if the KDE 4 codebase would shake out a little.

I might have waited for 9.04 except that I couldn’t get the KDbg documentation to run under GNOME. I like KDbg a lot; it’s a beginner-friendly front end to the highly human-hostile gdb debugger engine. I’d like to cite it in my book, but there are a couple of things about it that I just can’t figure. Press F1, right? Well, when I do that, I get a mysterious error dialog:

Could not launch the KDE Help Center:

Could not find service ‘khelpcenter’.

I assumed at first that this is what happens when you have a KDE app running under GNOME, but the kate editor is also a KDE app, and its help document comes up without any trouble. The khelpcenter4 package is installed on the system. The obvious thing to try is to run KDbg under KDE, and see if things work any better.

Of course, to do that you have to have a running install of KDE.

I downloaded the latest Kubuntu ISO (in 13 minutes on BT!!), burned it to CD, and booted the live install on my SX270, the same machine on which Ubuntu 8.10 installed without a glitch. Kubuntu detected the monitor resolution, but…the display blacks out every six seconds for about three-fourths of a second. Otherwise (heh) it runs perfectly. The blackout is not a fade; the screen just turns black instantly. It made me a little nuts, but I suffered through this game of desktop peek-a-boo long enough to install KDbg. I pressed F1. Same dialog. KDE can’t seem to make its own help system work.

So KDE is on that certain list of mine right now. Even though it displays the assembly source for single-stepping, KDbg won’t display named initialized data in NASM executables, and the Memory window refuses to display anything, initialized or otherwise. Being able to inspect data in memory is mighty damned useful, and I’m starting to think that KDbg isn’t really set up to debug assembly language. Like almost everything else in the Linux world, it’s a C thing. Maybe there’s a magic command-line option that allows it to interpret stabs format debug data for assembly language, but there’s nothing much about it online. Clues welcome.

And Kate? The only thing it lacks is a shortcut for running make or launching a debugger, but that’s easy enough to do in the terminal window. It’s graspable enough for beginners, and that’s what I’m striving for here. Newcomers should not have to learn EMACS or gdb to make “Hello world” happen in assembly.

I don’t want to have to use gdb Insight (if there’s an uglier widget set than Lesstif’s I’ve yet to see it) but if I can’t get KDbg to browse data in memory, I may have to. And the decision has to be made soon. (I feel another headache coming on…)

Odd Lots

  • German model train manufacturer Marklin has filed for bankruptcy, though there is still some hope that the 150-year-old firm will remain in business. Thanks to Pete Albrecht for the link.
  • Scientific American has an interesting retrospective on the infamous nuclear-powered B-36 that actually flew back in the late 1950s, with a live, air-cooled fission reactor in its rear bomb bay. I’m less twitchy about nuclear than almost anyone I know, and that item still gives me pause. (I do think that the stock B-36 was the coolest military aircraft of the transition period between props and jets, and one of the coolest of all time, period.)
  • From Rich Rostrom comes an aerial photo of the Fovant Badges, which are a group of military insignia cut into the Wiltshire chalk downs in southern England. They date back to WWI, and have been laboriously maintained since then–a job and a half, considering that some are over 200 feet wide.
  • When I first heard Cher’s uber-irritating hit “Believe” years ago I wanted to know what sort of processing was going on with her audio. I didn’t want to know enough to search too deeply, but it recently turned up on Slashdot. The gadget is called Auto-Tune. And Cher can actually sing when she wants to; one wonders what it could do for no-voicers like Bob Dylan.
  • I’ve never paid much attention to KDE’s Kate editor, but discovered today to my delight that it has syntax highlighting for NASM. I’d basically given up trying to find a lightweight Linux assembly language IDE to describe in my book, but half an hour of lightweight fooling around with it makes me think that Kate might be the one. Now all I have to do is become an expert in the next couple of weeks. Are there any books on it, print or e? I looked around and have found nothing so far.
  • From the Words I Didn’t Know Until Yesterday Department: interpunct, which is a small dot used originally in Latin to unambiguously mark the spaces between words. It’s still used today to show you where the invisible characters are on your screen, and I recognized the concept immediately, but never knew what it was called.
  • From ditto: A placket is a flap of cloth that hides a button on fancy clothes. I have a pair of pants with one, and again, never knew what it was called until very recently.
  • Pete Albrecht pointed out a source of very nice cast aluminum house numbers in the Craftsman style–though at prices like these, I’m glad I have only a 3-digit address.
  • From the Painting the Devil on the Wall Department: One of the nation’s leading promotors of monster truck shows was run over and killed by a monster truck at one of his own shows. (Again, thanks to Pete for the link.)
  • From Ed Keefe comes a pointer to a stunt kite fitted out with a microcontroller, an accelerometer, and LEDs so that it could be flown at night and turn different colors depending on how fast it’s going and which way it’s pointing. I flew a kite at night in 1965 and only knew what it was doing by the crackle noise it made and how hard it pulled on the string. Technology advances…

The Yard’s All Out of 3 X 4s…

I’ve gotten far enough into the revision of Assembly language Step By Step that I need to have a Linux machine running up here in my office all the time. I often spend hours in Ubuntu on this dual-boot machine, but there are still some things I need to do in Windows, and booting in and out to bounce from one to the other is time wasted, and pointless when I have old PCs stacked like cordwood in the basement.

SX270AndBracketOnDesk2.jpg

I have one of the very cool SX270 stainless-steel all-in-one brackets that combines a 10cm VESA monitor mount with a couple of tangs to hold an SX270 mini-PC behind the monitor. It makes for a very compact system, and in fact it was the integration of the SX270 and the monitor on the bracket that first brought the SX270 to my attention some years back, when I saw a couple of them at our optometrist’s office. So I took my spare SX270, parked it on the bracket, dug a Dell keyboard and a mouse out of the odd lots box, and realized that I did not have a VESA monitor to hang on it. So off we went to Best Buy, where I learned from the earnest young woman in the computer department that they had not sold 4:3 monitors for almost a year now. Every single one in the long line on display was 16:9.

I know why this is the case (home theater) and whereas it wouldn’t be my first choice, I’m willing to use that form factor, and really needed a monitor. I was apprehensive for a simple reason: The SX270 was made in 2003, and I don’t recall the machine supporting the 1600 X 900 resolution of the smaller 16:9 LCDs. I took a chance, figuring (or at least hoping) that I could rummage around online and come up with a newer driver for the Intel 82865G graphics chipset.

What I bought was a Samsung SyncMaster 2033SW. It’s VESA-compliant, and I bolted it to the stainless steel bracket without difficulty. It was on sale for $179. The machine itself cost me less than that; I think $150 on eBay some time last summer. 2.8 GHz, 1 GB RAM, with XP Pro–used and used hard, and ugly up close, but completely functional. I went up to Dell’s site to see if newer video drivers were available, but what they had was what I had. The closest that Windows could come to 1600 X 900 was 1280 X 768. The monitor centered the smaller raster in the middle of its screen, with the surrounding pixels dark. There was a “stretch” option that spread the raster out to the full extent of the screen, but it looked hideous.

Fortunately, Windows wasn’t the goal here. I booted the Ubuntu Intrepid installer CD in LiveCD mode to see what the OS would detect and how it would respond, considering that the machine dates back to 2003. Without a grunt of complaint, it detected the graphics hardware and loaded a 1600 X 900 driver. I tried a few things, pronounced it good, and told the OS to go install itself in earnest. Twenty minutes later, I was downloading NASM, Kdbg, the Bless Hex Editor, Nemiver, ddd, and a few other things through the Synaptic Package Manager. Not once did I have to face a command line. Everything Just Worked. The age of the machine (apparent from its collection of dents and inventory-tag stickum) didn’t seem to matter at all.

The display is gorgeous; it’s easily the brightest LCD I’ve ever seen. The whole gadget takes up about as little space as anything with a 20″ monitor possibly could. And after spending an afternoon with it, I realize that a long horizontal aspect can be handy: Editor on the right, Kdbg on the left, and just enough of a terminal peeking out under the editor to run make as needed.

I’ve been fooling with Linux intermittently for well over ten years, and the craziness of today’s events still boggles me: It installed much faster and way more easily than Windows generally does, and on old hardware to boot. This was not the case in 1999, let me tell you. If MS isn’t in trouble by now, it’s nobody’s fault but our own.

Odd Lots

  • The United States has overtaken Germany as the world’s lead producer of wind energy, measured in total kilowatts. Way to go–keeping in mind that Germany still beats us all hollow with kilowatts per capita. I’m a big believer in NWS, in that order, and part of the reason N comes before W is that over the past few years, when Carol and I have passed giant wind turbines along I-80 on our way to and from Chicago, they were only turning about a third of the time. Wind energy is great, but it does not stand alone.
  • Small children should be allowed to get dirty as a way of building their immune systems. I was digging in the back yard since before I can remember, and never had much trouble with allergies. There may be a downside to our dirt- and germ-averse culture that has nothing to do with the risk of antibiotic-resistant pathogens. (With Gretchen’s approval, I think I’m going to buy our nieces a couple of garden trowels next Christmas…)
  • Few people today remember that Apple Computer was once a Pascal shop, and had a promo poster in the late 70s incorporating a classic “railroad” diagram of Pascal language syntax. Yes, the 70s really did look like that. (At least it wasn’t all done in Harvest Gold.) Thanks to Paul Santa-Maria for the link. Paul created his own version of the poster in black and white, which I hope he makes available at some point. The Waite Group sold (or gave away; not sure if it was a boom promo) a similar card in the same era, but it’s long since vanished from my collection.
  • Has anyone here ever read any of the Very Short Introduction books from Oxford University Press? Are they useful? I just ordered several, and I’m curious as to the quality of the series. I’ll report here once the books show up and I’ve had a chance to read them. There are many subjects I’m interested in sufficiently to read 150 pages on, but not 600 pages.
  • A German publisher wrote an article claiming that cheaper ebooks will put them out of business. (The article is in German; take what you can from the English summary or if you know the language, click through to the original.) The gist is that there are special costs associated with e-publishing that more than balance the special costs associated with print publishing. My take: If true, it’s only until we get up to speed. (I also think it may be true that many publishers don’t really understand all the forces that bear on how they make their money. Many things lead up to the cash-register’s beep, not all of them obvious.
  • I’m a lot less sanguine about the OLPC than I used to be, but the recent unveiling of future designs intrigues me: The next-gen OLPC will have two displays, and can be held and read portrait-style, like a book. When a keyboard is needed, rotate the device 90, and one of the two displays becomes a keyboard. Very cool, and something like that should be sold worldwide by every electronics retailer. (Their peculiar distribution mechanism will eventually be the end of them.)

Cleaning Up 21-Year-Old Writing

Context changes are expensive, whether you’re a writer or an operating system. That’s why I like long, uninterrupted days to write. Writing in small chunks on large projects never worked well for me; I’d rather pull three ten-hour days than find thirty disjointed hours in the course of a week and waste half of each of them trying to recover my train of thought.

So it’s been with the fourth edition of Assembly Language Step By Step. I’ve spent most of the last four days blasting away at it, and if I haven’t returned to the Carb Wars here, that’s the reason. All in good time.

This is a big project, probably the biggest I’ve attempted since Drive-by Wi-Fi Guide, and it’s likely to be eating my life until June. There’s a great deal of new material to be written, and a lot of concepts to be covered that just weren’t issues under DOS. For example, when you work at the assembly level under Linux, endianness comes into play and needs to be explained, even though 85% of the world’s desktop hardware is little-endian.

That’s actually been fun; as I’ve said many times, the very best way to make sure you understand something is to explain it to somebody else. What’s been humbling is running into writing bad enough to make me wince. Every so often, I have to push back in my chair, heave a deep sigh, and ask myself the purely rhetorical question: “Geez. Did I write that?” (I did. 21 years ago. Practice helps…)

No problem; this is what editors do, though I am very glad that we’re not using typewriters anymore. And unlike certain other projects I’ve worked on, the author in this case takes criticism well.

Odd Lots

  • In one of my rambles around the Web looking for interestering perspectives on education, I ran across this very insightful (if possibly misnamed) blog post. My take: We are teaching an entire generation that their own blathery opinions are unassailable. Be Afraid. Be Very Afraid.
  • From Frank Glover comes a link to recent research suggesting that too much artificial light at night correlates with higher risk of breast and prostate cancer. More research is needed, but if the answer is to go to bed early and sleep in a dark room, Carol and I have it covered.
  • Rocky Jones’s Silvercup Rocket is well along on its restoration, and this page has both period and recent photos, as well as the best history of the Rocky Jones TV show that I’ve seen anywhere. (Ok, I’m biased–two of the photos are mine!)
  • Many people who have read my Hi-Flier Kites article have asked me what sort of paper was used to make the dime-store paper kites of the 1960s. I’ve asked around and tried any number of papers, but now I think I’ve come fairly close with a type of paper made in Germany and called–sunuvugun–“kite paper.” For some reason it’s popular with the Waldorf school crowd, though not for making kites. You can get it in 19 1/2″ X 27 1/2″ sheets, albeit only in 100-sheet lots, from A Toy Garden. That’s a little smaller than the Hi-Flier 30″ kite, but it’ll work. As spring gets a little closer, I’ll make one and report back here.
  • What the Waldorf schools do with kite paper is in fact impressive; this Flickr album scrolls through a good many photos of Waldorf traditional origami stars made with kite paper.
  • From Bill Higgins comes a link to Low End Mac, a site devoted to older Mac machines, especially pre-OS/X.
  • Pete Albrecht sends hope that Maurice Lenell may not be out of business, though their suburban Chicago plant will be razed to make way for yet another damned shopping mall.
  • I have several reasons for opposing contact team sports in schools (as opposed to careful weight training and aerobics). This is another one.
  • The three things I was afraid of as a six-year-old were robots, mummies, and volcanoes. I’ve made my peace with robots and mummies, but volcanoes still give me the willies, and our Alaskan citizens are watching another one nervously.
  • In case I don’t remember to mention it tomorrow or Sunday, Puppy Bowl V on Animal Planet kicks off at 3 PM EST Sunday, 2 PM central, 1 PM Mountain. When you get good and tired of watching spoiled-brat millionaires get the crap beat out of them by other spoiled-brat millionaires, the puppies may be a blessed relief. We never miss it anymore.

Cruzer Micro Skin

I’ve been using removable storage for a long time, and five years ago I moved from Iomega ZIP 250 MB disk cartridges to Cruzer Mini 256 MB thumb drives. I chose the Cruzer Mini line for a slightly weird reason: They fit comfortably in the pencil groove of my Northgate keyboards. Not all thumb drives do, and I’ve found it very convenient to have all of my active removable storage devices sitting there right where I can grab them.

Five years on, and not a single one of the Cruzer Minis has ever given me a lick of trouble, though I destroyed one once by working too fast. SanDisk no longer makes Cruzer Minis, and the ones I have are fairly small, some only 128 MB. This makes for lots of thumb drives lying around; for example, I had to put each one of the five Carl & Jerry books on its own Cruzer. It was time to scout out something else that would fit in my pencil groove, and with considerable delight I discovered the SanDisk Cruzer Micro Skin. They’re shorter than the Cruzer Minis, and a little narrower. No problems keeping them in the groove.

I bought them for their size, and didn’t understand the line’s gimmick until I had one in my hand: The Cruzer Skins are inside a flexible, tough plastic sleeve with an end cap of the same material. The skin and cap fit the metal body of the device very closely, enough so that if you dropped one in the sink the works wouldn’t even get wet if you pulled it out within a few seconds. (I’m guessing that they float, in fact, though I’ll let somebody else do the experiment.) You can remove the sleeve and apply a Brother-style label to the drive body, and then wiggle the sleeve back over it. This protects the label, especially if you drop it in your pocket with your car keys, as I’ve done a time or two. (Brother labels mar very easily.)

They’re yawning huge compared to my five-year-old Cruzer Minis. I recently bought several 4 GB units for $12 each, and an 8 GB (for $20!) to hold all five Carl & Jerry books, including high-res raw scans of all the 300+ illustrations. I’ve been able to consolidate several ongoing book projects from separate 256 MB cartridges onto a single 4 GB unit. The caps don’t fall off; you have to yank them. They don’t come with lanyards, but you know, I have yet to see anybody keep a thumb drive on a lanyard. (A lanyard loop is there at the end of the unit if you want to make your own, like we did at summer camp in 1965.) We’ll see how they hold up over time, but right now, I say highly recommended.