2010年10月20日

Assembly Language book for beginner
汇编语言入门书

推荐一本汇编语言入门的书:PC汇编语言 (PC Assembly Tutorial) ,推荐的原因不是说它写得多好,而是它写的相当简洁。

中文翻译版 177 页,每页字不多。很适合没有耐心的C/C++程序员使用。花三天时间,每天几个小时就能轻松掌握了。看完就能用汇编加速C/C++程序,这三天太值了。

而且内容叙述和例子的比例也很恰当,一边看,一边把例子敲一遍出来,脑力体力结合,人性化得很。

中文版的翻译不多的几个细节表述的不清楚,要多想两遍,不过总体来说,非常清晰,容易理解。感谢原作者和翻译者。

对于书里描述不清楚的地方,再配合著名的 汇编的艺术(The Art of Assembly Language Programming) 查找相应的指令解释来看,就补齐了。

语言掌握后,更多的指令用法,就像查程序库API的用法一样,用到的时候翻汇编的艺术就可以了。

汇编的艺术的问题在于太全了,丛头到尾,那么厚一本书,怎么看都看不下去。做为参考书,具体编程的时候查看,再深入研究还差不多,用来入门不合适。



I've spent 3 days to finish the Chinese version of PC Assembly Tutorial. After reading the book, one should be able to get start with accelerating C/C++ programs use assembly programming. It's very easy to follow and has the right amount of examples to get you feel the language.

Highly recommend to C/C++ programmers who want to get start with the assembly language.

The reason I recommend the book is that the book is very concise and easy to follow. There's only 177 pages with not too many words per page for the Chinese version. Of course any other language version will be a little longer since Chinese script is one of the most concise script in the world. But the point still stands.

The book comes with translated version to several languages.

On the other hand, the Art of Assembly Language Programming is too comprehensive for beginners. I'd guess it's a good reference book for assembly programming but definitely not a good dive in book. At least I was not patient enough to finished it on several tries.

2010年5月2日

mp3 tag encoding/charset convert

So I was trying to convert id3 tags of some music files from Chinese GBK encoding to UTF-8 such that the Audacious can read the tags. Well, after thoroughly searching the web, I finally found one that is packaged on Debian/Linux.

The program is called mid3conv. It's kinda of a demo script for the python-mutagen package, hence the 'm' before the id3conv name.

Apparently, the demo tools in the mutagen is not well advised. Those are:

  • mutagen-inspect (1) - view Mutagen-supported audio tags
  • mutagen-pony (1) - scan a collection of MP3 files
  • mid3iconv (1) - convert ID3 tag encodings
  • mid3v2 (1) - audio tag editor similar to 'id3v2'
  • moggsplit (1) - split Ogg logical streams

So if you want to convert some ID3 tags in legacy encoding or charset of CJK (Chinese/Japanese/Korean) in your mp3 files, try to install 'python-mutage' and use the command line tool mid3conv.

2010年4月8日

Solve error: the symbol 'grub_puts_' not found

Everybody and their mom know that Grub2 (version 1.98 as of today) sucks. I got bitten by it twice in 2 grub upgrades on my Debian box.

The latest one is the error: the symbol 'grub_puts_' not found.
And a useless prompt: grub rescue>

After fooling around with all the tinycore linux, kubuntu livecd images, I found the easy way out.

I just burned a Super Grub Disk and boot into my Debian with it using an old /boot/grub/menu.lst leftover from the grub 0.97 era.

I have to use the 0.9799 version of the super grub disk since the latest grub2 compatible versions 1.30/1.21 images are not bootable at all.

Once inside the Debian, do a
    # grub-install /dev/sda

to put the grub back on my 1st hard drive. voila!


Yes, Debian forces this 1.98 version of grub2 onto users. Fuck whoever made that decision.