このサイトがやりかた分かりやすい
http://koujinz.cocolog-nifty.com/blog/2009/04/24bit-8bit-a879.html