2005-11-01から1日間の記事一覧

K

S の mallocは適当なレジスタにでも書き込ませればいいとして何とかなりそうだが、型が困った。 最終的には、 #define K (k) #define S (s) として、 K K (10) (20) (30); みたいなのを動かすのが目標ですよ。 k(void* v) { unsigned char *func = (char*)ma…

関数型C言語

Cを関数型のように使いたい。 #include <stdio.h> #include <stdlib.h> #include <string.h> int (*flip(int (*fun)(int,int)))(int,int) { unsigned char *func = (char*)malloc(1000); func[ 0]=0x8B;func[ 1]=0x44;func[ 2]=0x24;func[ 3]=0x04; func[ 4]=0x87;func[ 5]=0x44;func[ 6]=</string.h></stdlib.h></stdio.h>…