Archive for March, 2007

Touchpad, WLAN, HP 500, HP 510, Ubuntu

Sunday, March 25th, 2007

I’m posting this here just to give it a little more Googlability in the hope that people might find it more easily than I did.

If you install Ubuntu on a HP 510 or HP 500 laptop you’ll find that the touchpad doesn’t work. Then you’ll find this page which details a fairly crufty kernel hack to get the touchpad working. It also explains how to select the native 1280×800 screen resolution.

Having done that you’ll reboot and find that the WiFi isn’t working. If you’re really lucky you’ll then find this thread that explains how to fix the WLAN.

Or you could just follow those links. Now if I could just get DHCP working on the WLAN I’d be happy…

FizzBuzz in 6502 assembler

Monday, March 12th, 2007

FizzBuzz is an extremely basic competence test for programmers. So I thought I’d write a version extremely in BASIC. Here it is in BBC Basic’s embedded 6502 assembler. For added geek points I used a 6502 emulator written in Perl to develop it on.

Just don’t ask why.

   10 REM FizzBuzz in 6502 assembler
   20 DIM code% 1000
   30 OSWRCH = &FFEE
   40 OSNEWL = &FFE7
   50 work = &70
   60 DIM FizzM 4 : $FizzM = "zziF"
   70 DIM BuzzM 4 : $BuzzM = "zzuB"
   80 FOR pass% = 0 TO 3 STEP 3
   90 P%=code%
  100 [opt pass%
  110
  120 .FizzBuzz  LDA #1
  130            LDX #3
  140            LDY #5
  150 .FB1       SEC
  160            DEX
  170            BNE FB2
  180            JSR Fizz
  190            LDX #3
  200 .FB2       DEY
  210            BNE FB3
  220            JSR Buzz
  230            LDY #5
  240 .FB3       BCC FB4
  250            JSR PrDecimal
  260 .FB4       PHA
  270            JSR OSNEWL
  280            PLA
  290            CLC
  300            ADC #1
  310            CMP #101
  320            BCC FB1
  330            RTS
  340
  350 .Fizz      PHA
  360            LDX #3
  370 .Fizz1     LDA FizzM, X
  380            JSR OSWRCH
  390            DEX
  400            BPL Fizz1
  410            CLC
  420            PLA
  430            RTS
  440
  450 .Buzz      PHA
  460            LDY #3
  470 .Buzz1     LDA BuzzM, Y
  480            JSR OSWRCH
  490            DEY
  500            BPL Buzz1
  510            CLC
  520            PLA
  530            RTS
  540
  550 .PrDecimal STA work
  560            PHA
  570            TXA
  580            PHA
  590            LDA #0
  600            PHA
  610 .PrDec0    LDX #8
  620            LDA #0
  630 .PrDec1    ASL work
  640            ROL A
  650            CMP #10
  660            BCC PrDec2
  670            SBC #10
  680            INC work
  690 .PrDec2    DEX
  700            BNE PrDec1
  710            CLC
  720            ADC #ASC"0"
  730            PHA
  740            LDX work
  750            BNE PrDec0
  760 .PrDec3    PLA
  770            BEQ PrDec4
  780            JSR OSWRCH
  790            JMP PrDec3
  800 .PrDec4    PLA
  810            TAX
  820            PLA
  830            RTS
  840 ]
  850 NEXT

Visual Studio: Before / After

Thursday, March 1st, 2007

Microsoft have a great ad for Visual Studio inside the front cover of Dr. Dobbs journal. Check out these pictures:

Before After
(click for larger version)
Before After

The first guy has a huge ugly laptop, a meaningless award on his desk. He clearly has no manners; in spite of the two women standing right next to him he’s wearing headphones and brandishing a tacky looking PDA / MP3 player / phone / whatever. His body language screams “I’m far too important to talk to mere girls”. He’s got an unhealthy BMW fetish going on too. Not only has he left his Beemer keyfob ostentatiously draped on his desk, he also has both a model of the car (his true love I fancy) and a picture of him standing next to the real thing. Just in case we miss the fact that he OWNS A BMW.

Anyway, then he discovers Visual Studio and experiences quite a transformation. He realises the award was just a crude attempt by his employer to make him work harder without paying him more. In its place is a paperclip parody of the award. Hah! His laptop is smaller and more tasteful. He now takes his headphones off in the presence of others. His keys are just a bunch of keys. He’s ditched the vacuous status car and replaced it with a mountain bike. Amazing. I almost like him now.

Microsoft must be furious though: the ad has been printed with the panels reversed so that it looks as if using Visual Studio turns you into a boorish, smug, self obsessed cock. Too bad.


Copyright Andy Armstrong, 2005. Entries (RSS) and Comments (RSS).