2007-05-24から1日間の記事一覧

アセンブリ言語の教科書 第3章 数値のカウント(再帰で)

GCC

Scheme勉強中なので、GASで再帰します。 .text .global main main: push %ebp mov %esp,%ebp mov $10, %eax push %eax call count pop %eax mov $0, %eax leave ret count: push %ebp mov %esp,%ebp mov 8(%ebp),%eax push %eax push $count_s call printf p…

アセンブリ言語の教科書 第3章 Hello, GAS world!!

GCC

サンプルに少し改良を加えました。 .text .global main main: push %ebp mov %esp,%ebp push $hello call printf mov $0, %eax leave ret .data hello: .string "Hello, GAS World!!" 一見何の変哲もないHello,Worldですが、かなり罠が隠れています。1行づつ…