60void genAddress(
bool isJIT,
const char regTbl[][5],
size_t regTblNum)
67 for (
size_t i = 0; i < regTblNum + 1; i++) {
68 const char *base = regTbl[i];
69 for (
size_t j = 0;
j < regTblNum + 1;
j++) {
71 const char *index = regTbl[
j];
72 static const int scaleTbl[] = { 0, 1, 2, 4, 8 };
74 int scale = scaleTbl[k];
75 static const int dispTbl[] = { 0, 1, 1000, -1, -1000 };
77 int disp = dispTbl[m];
80 printf(
"mov (ecx, ptr[");
89 if (!isFirst) putchar(
'+');
91 if (scale) printf(
"*%d", scale);
95 if (isJIT) printf(
"(void*)");
96 printf(
"0x%08X", disp);
105 printf(
"]); dump();\n");
111 if ((
count % 100) == 0) {
112 printf(
"}\n void gen%d(){\n", funcNum++);
119 if (isJIT) puts(
"}");
122 printf(
"void gen(){\n");
123 for (
int i = 0; i < funcNum; i++) {
124 printf(
" gen%d();\n", i);