Saturday, December 29, 2007

The Best Documentaries

Kevin Kelly just released the third edition of True Films. This book has one page reviews of 200 of the best documentaries available. Each review has a few screen captures and an indication of where to rent or buy the films. With a Netflix subscription you can probably rent 80% of these movies.

I've watched many of the films he lists in the book; they are all awesome. Some are even life-changing. None of them have been boring.

Happily, Kevin is testing out an free, ad-supported version of the book. You can download this version from his site as a pdf.


Monday, November 19, 2007

Find Walkable Neighborhoods

Are you looking for a new place to live? Before you commit, check out the walkability score at Walk Score. Plug an address into the website. Out pops a map of the neighborhood. It gives a score measuring how many businesses, services, schools, parks, libraries, and more are within walking distance.

The walkability of your home and place of work can have a big impact on your quality of life. Having to drive will discourage you from getting out of your house as much, increase your stress levels, and reduce your opportunity for exercise.


Via Joel on Software.

Disney Cover Songs

Do you like Disney songs? Do you like cover songs? Then Covering the Mouse is the blog for you. Why they even stream samples of the songs!


Via BoingBoing.

Saturday, November 17, 2007

Oil Plug Gaskets

Since buying a used 2006 Honda Element to replace my Jetta and Econoline, I've decided to start changing my own oil again. I'm tired of waiting in grimy rooms, paying too much, and always wondering if the shop is going to make a mistake. Unfortunately, it turns out that auto part stores also can screw up and waste your time.

The oil pan drain plug on my Element has a little aluminum crush washer which ensures a tight seal to the drain pan. According to the manual, you're supposed to change these washers (also known as oil drain plug gaskets) with every oil change. The manual for my Gold 1994 Eagle Vision never mentioned changing a washer, so this is a new thing for me.

You wouldn't think finding a washer at the auto part store would be a problem.
It was. I located a section labeled "oil plugs" which had a small section of expensive washers. Although Auto Zone has a big book which tells you what oil filter to buy for your car, there was no book for the washers.

I walked to the front desk and asked what washer I needed for the oil plug on my Honda Element. Instead of consulting a book or a computer, the clerk walked directly to the washer section and started poking boxes of parts. He handed me a box of M12 Nylon washers and told me this is the kind of washers the factory installed. That seemed fishy, so I asked if he was sure. He was.

I purchased my overpriced washers and went home. Still skeptical, I googled around for what size washer I needed. All I could find was one page mentioned 14mm washers. Mine had about a 12mm inside diameter. I felt quite happy that I had not drained the oil from my vehicle.

Inspecting the box of wrong parts, I discovered that the washer manufacturer had a web site. Even better, Dorman Products has an online parts guide which lets you search by vehicle. Consulting the guide, I learned that I needed an aluminum M14 washer.

I returned my Nylon M12 washers to Auto Zone where a more helpful clerk double-checked the part numbers and exchanged my purchase. It seems to be the correct part: it fit perfectly.

Lessons learned: even simple home maintenance can be fraught with peril and waste lots of time. Also, you reach the nearly-invisible Element oil filter through the passenger-side wheel well (turn the steering wheel hard to the left). Finally, there are still bits of data out there that Google has difficulty finding. I'm amazed that more cars don't disintegrate on the road.

Thursday, November 15, 2007

Listen to the Drabblecast

I always laugh when I listen to The Drabblecast. There aren't many podcasts out there that can do that.

The Drabblecast is about 80% flash fiction -- one to two thousand word stories. The tales are generally weird, sometimes gleefully repulsive. Norm Sherman performs all the narration himself, which is part of the appeal. His voices and sound effects are great.

Norm's commentary makes up the remaining 20% of the show. Following the theme, the commentary is also about the weird and absurd. Norm's take on "current events" is a riot, as are his reenactments. My favorite segment of all time has to be his coverage of the gruesome death of a duck in the lobby of an Embassy Suites. Listen to episode 35.

If you cherish the absurd and strange, give the show a listen. I don't think you'll be disappointed.


Wednesday, October 17, 2007

Is Your Doctor Dangerous?

I enjoy learning facts that destroy popular beliefs. This entry on Overcoming Bias explains how many medical doctors are a danger to their patients.


Sunday, October 14, 2007

Fight Corruption with Lawrence Lessig

Larry Lessig has an entertaining new presentation on Corruption. My brain was bent several times by the clarity of his points. I wish I was half as good at presenting as the professor is.

Link. Via Boing Boing.

Here is a link to the Sunlight Foundation, mentioned in the presentation.

Sunday, October 7, 2007

Movie Trailers. From Hell. With Commentary.

Are you looking for an entertaining way to waste more time on your computer? Check out Trailers From Hell. On the site you can watch old trailers (that is, movie previews) with commentary from various directors.

The film previews run the spectrum from b-flicks to classics. Sometimes the commentators critique the film, sometimes they talk about its history, and sometimes they discuss the gossip. In any case, this site should excite both film buffs and MST3K junkies.

Link. Via Boing Boing.

Thursday, October 4, 2007

Negotiating Everything

Negotiating a price down feels great. Unfortunately, asking for a better deal feels uncomfortable in most situations. If you feel rude when you try to make a deal, read this. Tom Chiarella writes about his crazy experiences haggling for everything.

My favorite trick for getting a deal is requesting a customer loyalty discount. I do this every time I have work done on my car. I've never been turned down.



Card Catalog for the Planet

Cool Tools just reviewed an amazing website that lets you search for books, articles, and other media in libraries around the world. WorldCat not only tells you which libraries have a particular book, but they also often link to that library's online catalog. In the case of Austin's public libraries, this means you can view the status of the book and which branch has it.

The site also has some other interesting features like reading lists, reviews, and links to buy on Amazon. Libraries are a great way to save money and prevent clutter. WorldCat should make it easier to find and read the books you want without buying them.


Thursday, September 27, 2007

Save Money When Buying a Car

Dumb Little Man recently featured a great video of Rob Gruhi explaining how to negotiate the best price for a car. His advice is specific to new cars, but most of the principals apply to used cars as well.

Here are some of my thoughts on buying a used car, based on my recent experience:
  • Rob is correct that most of the time you won't get the best deal on a trade in. Still, you may wish to ask. The dealer might be more willing to give you a high trade-in value rather than a low purchase price. Also, a trade in can lower your sales tax.
  • CarMax can give your trade-in a free appraisal. I think their business model is basically to give low appraisals and high purchase prices, but I've heard the occasional person gets lucky. Still, the appraisal can give you a more objective view of the car's condition for pricing using Bluebook or Edmunds. If you do get a good price, they will buy the car even if you don't buy one from them. The process took me about an hour. The appraisal I got was thousands too low -- I sold the car for 27% more.
  • Like Rob says, the "off the lot price" is key. Never let the dealer talk about another price.
  • To reinforce Rob: don't buy the first time you visit/call/email the dealer. You want to give the impression that the car fits your needs, but that you have plenty of other choices available. Ask for their best "off the lot price", tell them that it's too much, leave.
  • Don't feel like a jerk. The sales guys want you feel bad for not buying a car. They'll act like you're the first person not to buy a car at full asking price. Don't fall for it. I called and bugged one sales guy to lower the price until he told me that he wouldn't talk to me anymore. In retrospect, I think this was just a gambit -- I should have kept pressing.
  • Sales guys also like to build pressure on you by doing favors. They're just doing their job. "I talked to Bob, the sales manager for you." Trust me, he wasn't representing you. They were probably joking about how they would spend your money.
  • Say no to extended warranties, even if you want one. I told the guy that I wasn't interested in the warranty and he immediately cut its price almost in half. I still didn't buy it.
  • As you find cars that meet your needs put them in a spreadsheet. I tracked these columns: make, model, year, mileage, warranty (does it have a factory warranty?), date I first found it (so I know how long it has been on the market), blue book value, and a list of prices as they change in time. I log the price I get to for each interaction with the seller. If you build data over a month, it will help you identify good candidates for a bargain.
  • If there are lots of cars of a type on the market, point it out to the seller. My father once carried a giant flapping stack of Autotrader printouts to show off. It worked.
  • Just because the bluebook (or whatever) gives a certain price doesn't mean that you couldn't do better. Those values are averages. Think of a bell curve -- you want to be on the edge, not the middle. I paid thousands below book value on my last car.
  • Some dealers seem to intentionally do a poor job of responding to requests for bids by email. Often they will just repeat the ad or ask you to call. Usually I get the data I want when I reply and repeat my request. Don't be afraid to call and ask for the "internet manager" either.
  • Look for used cars on dealer websites, not just Craigslist, Autotrader, and your newspapers. Especially look for luxury cars being sold by non-luxury dealers. Likewise, look for ordinary cars for sale at luxury dealers. A friend once got a great deal on an Audi that had been sitting ignored for months on a Kia lot.
  • Don't let the dealer try to steer you towards a cheaper vehicle when you make a low offer. Be firm. The dealer will act like you're crazy for thinking you can get "that much car" for less than asking price. This could be a good point for showing off your stack of printouts.

Sunday, September 23, 2007

The Camera Map Hack

I often feel like an idiot when I have to consult a map while standing on a street corner. Now -- thanks to technology -- I only feel like a nerd.

Instead of printing out my Google maps and directions, I take a quick photo of my computer screen using my digital camera. I could take a screen shot and copy the image file onto my camera -- but a quick snap of the screen is faster and works fine.

When I need to consult my map or directions, I put my camera into playback mode and use the controls to zoom in on the relevant area. Instead of looking lost, I probably look like some sort of camera dork.

Clearly this isn't a good solution if you're driving: please let your passenger do the navigation. Otherwise the camera map hack is a fine way to save some ink and paper.

Wednesday, September 19, 2007

Joel is a Funny Guy

"And Paul Graham gives them another 6000 boxes of instant noodles to eat, so they stay in business another three years..."

Monday, September 17, 2007

How Making Appointments With Yourself Can Help You Get More Out Of Your Day

I have a confession to make. I'm not very good at keeping a to-do list. In fact I don't really even keep one. To-do lists make me feel bad. Terrible even. When I sit down and see all the tasks that I've been neglecting, I want to run away and join the circus. Witnessing the sheer magnitude of all the things I should and could do stresses me out.

The problem starts with the three or four urgent and important items I always have. No matter what, I always seem to have 3 or 4 of them. When I finish one, I inevitably pick up another task to replace it. The remaining tasks either aren't important or aren't urgent. Items that aren't important I can ignore -- thankfully. But I can't ignore the important but non-urgent.

Those important but not urgent items are trouble. With or without a to-do list, these are the tasks that never seem to get done. Those items -- the sea of important but non-urgent -- build quickly and stick around because the urgent problems get all the attention. When these tasks do get finished it is often by virtue of getting moved to the urgent category. Not pleasant.

Training is my classic example of a important but not urgent task. I want to spend a little time every day learning new skills. This training isn't urgent. I could skip a session on any given day without consequence. Unfortunately, urgent tasks pressure me to skip almost every day. Even if I did manage a big to-do list, this would probably happen naturally as I prioritize my tasks. Urgent items are very compelling -- by definition, the other tasks can wait.

How To Get Tasks Done Without Making To-do Lists

So what is my solution? I schedule non-urgent tasks in my calendar. I just pick a date and time and schedule the task just like I would a meeting. What used to be a big scary list is now spread out across the calendar in bite-sized chunks. As a bonus, if you also schedule your urgent + important items, you can use the calendar to have very fine control over how much time you spend daily on each task.

Does it seem odd to schedule time for tasks that are not urgent? You might say that by scheduling the tasks you're making them artificially urgent. When your calendar reminds you to do a task, suddenly it's urgent -- but just for the scheduled time. Although the task wasn't urgent before, you must act like it is when the scheduled time arrives. This artificial urgency is the whole point. If your task never becomes urgent, you may never complete it.

By making an appointment with myself, I force myself to actually make time. Urgent items get put off for a moment while other important tasks get addressed. This makes it a lot easier to justify spending time on myself - I can build the balance between different projects, between work and life right into the calendar. The calendar becomes the plan.

Potential Issues:

This method of tracking tasks has some limitations. First, it requires that you actually obey the calendar. If you often ignore or miss appointment notifications, this probably won't work for you. Similarly, if your daily schedule isn't somewhat predictable, you may end up with tasks schedule when you can't possibly work on them.

Another issue is that you need to be around the computer so you can get notifications. There are some possible workarounds: Google Calendar for instance can SMS reminders to your mobile phone. Some PDAs, cell phones, and iPods can synchronize with your main calendar.

If your work depends a lot on mental focus, this type of scheduling may be harmful. Lots of interruptions from the calendar can prevent you from getting in "the zone". In this case, you'll want to block off significant chunks of uninterrupted time.

Finally, the task of managing a calendar can eat up a lot of time. Depending on what software you use, finding tasks and rescheduling them can be painful. I personally enjoy Google Calendar because I can schedule tasks with one click and a plain English sentence: "Read GTD at 7pm", and search quickly too. On the down side, you need internet access to use it.

Final Notes:

This is just an idea that I have been fooling around with for the past few weeks. Over the long term there may be issues I haven't seen.

For more of this sort of thing, try David Allen of Getting Things Done fame, or Merlin Mann of 43 Folders. They are more or less my source of inspiration. Otherwise, let me know what you think. When you have time.

Wednesday, September 5, 2007

Choosing an Occupation

Most folks I know have had some trouble deciding what they want to be when they grow up. The technique of contemplating what you would do if you had a million dollars (as seen in Office Space) doesn't seem to help much. Instead, it makes you dream of all the ridiculous stuff you could buy.

I can't promise that it will work better, but I stumbled on another way to address the same problem. Ask yourself: what have you enjoyed helping other people do?

I think this attacks the problem more sensibly because it fits better with the purpose of an occupation. People pay other people money because they benefit or expect to benefit in some way. Imagining a million dollars doesn't seem practical, it doesn't require you to consider something that another person would find useful.

Thinking about how you have helped someone also encourages you to think about activities you have already performed. You are much more likely to understand how something makes you feel if you have actually performed the task. The question also indicates a sensible way of exploring occupational possibilities: helping other folks do their job or solve a problem.

Will this work? I don't know. Try it and let me know.

Tuesday, August 28, 2007

How Not to Attract the Best Talent Using Job Boards

Lets suppose for an instant that you wish to hire a really good software engineer. How would you attract some really good qualified candidates for the position?

If you are like a lot of businesses, you would put an ad on Craigslist. So far you're doing well. When I'm looking for a fun and interesting new job, I start by looking in fun and interesting places.

The next part is where we run into trouble. Craigslist and other job boards want you (the potential employer) to provide a headline to identify the job. This headline is listed on a page with all of the other job opening headlines. A potential applicant is expected to see your headline, somehow identify with it, and click on it for more information.

If you're familiar with the typical HR department, you won't be shocked to see that many headlines look like this:
Software Engineer (Austin, TX)
Senior Software Engineer (Austin)
Developer II (Austin)
Quality Control Specialist (North Austin)
Wow, such compelling headlines! At least one of those headlines managed to narrow down which part of Austin they are in. That was thoughtful.

Otherwise these are all terrible headlines which don't communicate much. Mostly they tell us that the poster probably works for the HR department of a large, boring corporation. Big boring companies like to carefully categorize each job. They make tables of salary ranges and rate each employee in six categories. Somewhere along the way they start to believe that titles like "Software Developer III" are sexy. They're not. They're typical and therefore boring.

Opposite the vague end of the spectrum we find specific. These headlines look like this:
Programmer: Java, C++, SQL, XML, Cobal, Perl (Austin)
C++ / Labview / Scheme Developer (Austin, TX)
Expert Needed: C, C++, Java, x86 assembly, SQL, Ruby, Python (Austin)
Potential candidates may marvel at these sorts of headlines, but most probably can't take them too seriously. I'm not an expert business guy, but I'd guess that there are maybe two or three people in all of Austin that would fit each of these jobs. Do you really feel that lucky?

I know that businesses like to hire folks that already know everything, but maybe you're limiting your choices too much. Lets apply the Pareto Principal to the problem: I'll assume that at each step along the way we eliminate 80% of the candidates.

Lets start by assuming 125 folks apply for your position. The 80/20 rule says 25 make it to the phone screen. Five continue to the interview in person. And now you have one candidate who you'll offer a job.

In this thought experiment you needed to 125 applicants to make an offer to just one person. That might be OK. But what happens if say that only 20% of your offers will be accepted? Now you need 625 applicants just to hire one person. Yikes! Can you even hope that 625 people will apply for your job that demands expertise in 3 obscure technologies?

The other problem with the typical specific style headline is that they are just a list of your demands. How many infomercials have you seen that start by telling you the price? None, I bet. They all start out by telling you the amazing benefits of the doodad. And so should your job post. Instead of Cut through copper pipe and tomatoes! try something closer to Come destroy the record industry with your 133t SQL skillz. How may applications would that get?

Sunday, July 8, 2007

Printing With Flickr

This weekend I decided to mail some photos to my grandmothers. The photos were digital so normally I might have printed them myself. Sadly, my HP printer has decided that it doesn't like my color ink cartridge anymore. I couldn't say if this is a ploy to sell more ink, but I have my suspicions.

I figured that there were probably lots of stores that could print my photos, but I didn't really want to futz around with a digital photo kiosk. I definitely didn't feel like spending an hour of my weekend waiting for the prints to be finished. I suppose I could have had prints mailed to me, but then I wouldn't get them for several days.

I looked for a solution on flickr, where I store all my digital photos. Turns out they have a photo printing feature that meets my needs perfectly. You can order prints by mail if you like. You can also print to your nearest Target store for more immediate gratification. In a world where ink cartridges cost nearly as much as a new printer, outsourcing print services down the street makes sense to me.

How it Works

First, you'll probably want to make sure that you've uploaded your photos at a reasonably high resolution. I have a flickr pro account so I always upload everything at the full resolution of my camera. As a general rule of thumb, you probably want your photo to appear on your screen at least twice as large as you intend to print it. Any less will probably look terrible, but different equipment will give different results. If you're unsure, a little searching on google can probably tell you the minimum acceptable resolution for a given print size.

Next, you need to find the images that you want to print in flickr. A little "order prints" icon should appear above each photo. When you click it, a menu drops down. This allows you to select the size and quantity of prints for that image. You can just continue adding photos to your shopping cart until you snag all the photos you wish to print.

When you check out, you can select Target as your delivery method. There is a link which lets you search for and select the most convenient Target location. When you're ready, you confirm your order. You're told the total cost of the order, but flickr doesn't charge anything online. Instead, you pay at Target when you get the photos.

Your prints magically show up one hour later in the Target photo lab. Just say your name to the clerk and you'll get your photos. At my Target, the images were labeled as coming from Yahoo, not flickr. This might confuse you, but it makes sense. Yahoo owns flickr, for better or worse.

The photos were printed on the same giant Fujifilm machine that normal photos are processed on. With the photos I had, the images looked almost identical to how they appeared on my monitor. The finished product looked nearly indistinguishable from a normal film photograph.

My two photos cost a grand total of $0.22, but I think this was a half-off promotional price. At my Target, you pay at the photo lab. This means you don't even have to wait in the normal line. The whole process took about two minutes once I found a parking spot. Not a bad setup considering how often I need to print out photos.

Sunday, June 10, 2007

Music: The Killdares at Fado Austin

I took my brother, Dennis, and Greg to Fado Yesterday, their last night in Texas. As a result, we stumbled on a performance by the Celtic rock band The Killdares.

The Killdares consist of a drummer, fiddler, bag piper, electric guitar, and bass guitar. They played a mix of original songs and electric folk rock arrangements of traditional Irish tunes. I don't know if electric folk rock is a real term, but hopefully it conveys what I'm talking about. Real toe-tapping music.

I thought the performance was a terrific way to end a lazy Saturday. I especially enjoyed the interplay between the fiddle and the pipes. The amount of coordination between the two artists really made an exciting performance. It reminded me of the fun I had playing violin in band and orchestra way back. Nothing can quite match the feeling of playing music with talented musicians. But watching from the audience is second best.

If you have a chance to see these folks play live, take it. I hope they come back to Austin soon.

Friday, June 8, 2007

Film: Solaris (2002)

Unless you don't mind taking some time to think about a film, don't watch Solaris. I really enjoyed it, but not everyone likes having to work for their films.

Don't get me wrong. The film has a lot going for it: great visuals, nifty ideas, tense pacing, and good (but minimal) music. I think the look and style of the film is great. It conveys lots of careful craftsmanship.

Just the DVD's title menu completely hypnotized me. I would really like to have a screen saver that just featured an evolving view of Solaris and a loop of the score by Cliff Martinez. Of course, then I'd spend my days drooling into my keyboard rather than getting stuff done.

But the film doesn't end with an explanation of what just happened. You won't find any explosions or even any loud noises. We're talking about science fiction on the 2001: A Space Odyssey side of the genre. Events revolve around people (or at least characters), not around gadgets or dogfights. This is the sort of film that will keep you up for the rest of the night discussing what happened.

I think I'll put the Stanislaw Lem story and the 1972 film on my to-do list.

Wednesday, June 6, 2007

Panic Button Usability Case Study

Tuesday night I stopped at HEB for some groceries. On my way out, I noticed that a car alarm was going crazy. As I passed the offending auto, I noticed that the doors of this shiny new Honda Fit were open and that there were two women inside. I decided I would offer help if the alarm was still going after I deposited the groceries in my trunk.

Sure enough, the alarm continued. Looking at the two women, I felt fairly certain they weren't car thieves. I smiled at them and gestured as if to ask if I could help. The passenger smiled and shrugged back, so I walked over.

The driver was flipping through the Fit's manual, clearly looking for a way to silence it. I asked if I could offer help. "Do you know how do I shut this off?" she asked.

"Do you have a remote control?" I asked in return.

"Yes, right here." She raised a tiny box.

"Did you accidentally hit the red panic button?"

"Yes, I tried pushing it again, but it won't turn off." She demonstrated and the horn glitched as the alarm sequence started from the top.

"Try pushing the unlock button."

And the horn finally went silent.

"Thank you. We hit the red button and the lock button, but we didn't think to push the unlock button."

"No problem. How do you like the car?"

"I like it a lot. It's very nice."

It actually did look pretty nice. "Cool. Have a good one."

Saturday, June 2, 2007

Podcast Watch: Singularity

Technically, Bill DeSmedt's Singularity probably should get classified as an audio book. Professional narration of a novel doesn't quite meet my notion of a podcast. Still, the work is available on as an iTunes compatible or RSS podcast feed. For free too (with a suggested donation).

I started listening to the book on my last trip to Corpus Christi. It worked great. The fast pace and nearly constant excitement made the four hour drive go by in a flash.

The book is science fiction, but think Robert Ludlum meets Michael Crichton. Events hinge on speculative science, but it mostly occurs in the near future (well, the past's near future... the 1990's) with plenty of explosions and fights. It's full of crazy science, but most of it explained so that a layman can follow easily.

There are some anachronisms in the novel. Technology evolved a little differently in our future than what was expected when the book was written. Some of the computer science and hacking stuff seems a little off too. Still, it's worth cutting the book some slack.

And that professional narration? It seems to have been done by the author personally. Color me impressed. The accents and voices are all done quite well -- I swear he sounds like a professional narrator. Link.

Selecting Stocks With Insider Trading

My friend Freddy has been researching different kinds of stock screens. One measure of a stock that we discussed was Insider Trading. When someone involved in the critical workings of a company buys its stock, good things seem to happen.

The notion is that an insider wouldn't buy stock in their own company unless they were confident the price would go up. I'm skeptical of the predictive abilities of humans -- especially executives. Still, I hear that you can find statistical evidence to support the idea. When insiders buy, the stock becomes more inclined to go up rather than down. Or so they say.

When I buy stock, I look for a dividend, a P/E ratio of 15 or less, and debt less than 50% of market cap. That's about it right now. Not that I'm terribly successful or very committed to picking stocks. Most of my exposure to stocks comes from Index funds and my 401k mutual funds. Don't mistakenly think that I'm a great stock picker or that I've even tested insider trading as a screen.

I am tempted though. Screening stocks for insider buying isn't hard. Freddy sent me this site: It seems to have all the data needed. One interesting trend I noticed from this site is that buying occurs an order of magnitude less frequently than selling.

Suggestive, isn't it? I find it amusing that so many folks defend exaggerated executive salaries when it seems most executives seem reluctant to keep their money in the organizations they run. Yes, I suppose they have some excuse. They don't want all their eggs in one basket. They need new vacation homes and fast cars. I understand, but I'm still jealous. And skeptical.

Leave a comment if you have experience with using insider trading as a stock screen (no investment spammers, naturally).


Cory Doctorow has been podcasting his fantastic story in progress, There’s a Great Big Beautiful Tomorrow/Now is the Best Time of Your Life. If you enjoy Mecha battles, Disney lore, paleo-futurism, immortality, and the ethics of technology and progress, you'll probably enjoy this. In fact, your head will explode. Link.

Wednesday, May 23, 2007

SDCC: Labels and Inline Assembly Errors

I have a bit of 8051 inline assembly that won't compile under SDCC. At the assembly stage I get the error message:

?ASxxxx-Error-<u> in line 727 of main.asm
  <u> undefined symbol encountered during assembly

Examining the asm file, it becomes apparent that the assembler can't find a label, even though the label clearly appears two lines after the reference. The code looks something like this in C:

  NOP; // do something or nothing

Names have been changed to protect the innocent. Don't ask me why the assembler can't find the MYSTERY_LABEL label. I considered examining the source code, I really did. I decided I just didn't have the time. I did find a solution though. Replace the nice, fancy readable label with a more "traditional" nnnnn$ format labels:

 JNZ 00023$; //jump to 00023$ AKA MYSTERY_LABEL
  NOP; // do something or nothing

This version of the code is less readable, but SDCC compiles it just fine. Happy hacking!