XBYAK

http://homepage1.nifty.com/herumi/diary/0709.html#25

call((int)func);

たまにおかしな動きをするのですが,私が悪いような気がしなくもないので
今度調べてみます.今日は今から飲むので・・・

お酒を飲みながら

void myputs(const char*s)
{
    puts(s);
}

struct Hello : public Xbyak::CodeGenerator
{
    Hello()
    {
        push((int)"hello");
        call((int)puts);
        pop(eax);
    }
};

struct Hello2 : public Xbyak::CodeGenerator
{
    Hello2()
    {
        push((int)"hello");
        call((int)myputs);
        pop(eax);
    }
};

int main(int argc, char**argv)
{
    Hello  h;
    Hello2 h2;

    ((f*)h.getCode())();  // OK
    ((f*)h2.getCode())(); // NG
    return 0;
}

だった.

あぁぁ

UMのJITにひどいバグがあるなぁ・・・ 前のコードに戻そうかなぁ
メモリのコピーを減らそうとして,スタックを食い尽くすとか,ひどい改悪をしたんだなぁ

socketstream

だいぶ前に修正したものをアップしておきました.
どんな問題点があったか覚えてないので,かなり怪しいですが・・・

blokus販売元のAI

http://www.blokus.com/online-game/

と戦ってみたら,勝った.4文字コードを打つのがめんどくさい.

blokus.png
  • ああ,それ関数の終わりにret()が無いです(^^; -- へるみ 2007-09-28 00:06:58 (金)
  • あぁ〜 そうですね.ありがとうございます.インラインアセンブラ感覚で使ってしまうとミス多発です^^; -- naoki 2007-09-28 01:11:54 (金)

お名前:
添付ファイル: fileblokus.png 158件 [詳細]