本文整理汇总了C++中GEN函数的典型用法代码示例。如果您正苦于以下问题:C++ GEN函数的具体用法?C++ GEN怎么用?C++ GEN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GEN函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: g_xchg_dx_ax
int g_xchg_dx_ax(void)
{
if (!lbl)
{
m--;
if (*m == 146) { DID(-1); }
m++;
}
GEN(146);
DID(1);
}
示例2: lookahead
bool lookahead(FastVolume * in, std::vector<int> &res, int start, int dir, int amount, int cur_gen){
int cur = start;
for(int i = 0; i <= amount; i++){
cur += dir;
if(in->mask[cur] & TRU)return false;
if(in->mask[cur] & (ZRO | MASK)){//we are out; mark everything in between
for(int j = i; j > 0; j--){
cur -= dir;
if(!(BDR & in->mask[cur])){
if(GEN((in->mask[cur])) != 0) //check if the cell already had a generation
in->record_operation(cur, BDR | (GEN(in->mask[cur])));
else
in->record_operation(cur, BDR | cur_gen);
res.push_back(cur);
};
};
return true; // was able to jump
};
};
return false; //no luck; just propagate one step.
};
示例3: g_pop_dx
int g_pop_dx(void)
{
if (!lbl)
{
m--;
if (*m == 82) { DID(-1); }
if (*m == 80)
{
return g_mov_dx_ax() - 1;
}
if (*m == 83)
{
return g_mov_dx_bx() - 1;
}
if (*m == 81)
{
return g_mov_dx_cx() - 1;
}
m++;
}
GEN(90);
DID(1);
}
示例4: primitive
//.........这里部分代码省略.........
}
v = atoi(token) / 39;
scan();
if (v > 255) v = 255;
g_pop_ax();
g_mov_ah_al();
g_mov_al(v & 0xff);
g_push_ax();
}
return;
}
if(token[0] == '"')
{
char * q = (token+1);
byte * b = stalloc(strlen(q)+1);
strcpy((char *)b, q);
g_mov_ax(caddr(b));
g_push_ax();
scan();
while(token[0] == '"')
{
char * q = (token+1);
byte * b;
stretract();
b = stalloc(strlen(q)+1);
strcpy((char *)b, q);
scan();
}
return;
}
if(tokeq("{"))
{
byte * l; byte * q; int c=0; int v=0; int lc;
scan();
l = m;
g_label();
g_nop();
assignments();
if (tokeq("}"))
{
scan();
g_ret();
q = stalloc(m - l);
memcpy(q, l, m - l);
m = l;
g_mov_ax(caddr(q));
g_push_ax();
return;
}
error("Missing }");
return;
}
if(tokeq("INLINE"))
{
byte * l; byte * q; int c=0; int v=0; int lc;
scan();
if(tokeq("{")) scan();
l = m;
g_label();
g_nop();
while(tokne("}"))
{
GEN(atoi(token));
scan();
}
scan();
g_ret();
q = stalloc(m - l);
memcpy(q, l, m - l);
m = l;
g_mov_ax(caddr(q));
g_push_ax();
return;
}
if(tokeq("("))
{
scan();
boolexpr();
if (tokeq(")"))
{
scan();
return;
}
error("Missing )");
return;
}
if(tokeq("*"))
{
scan();
boolexpr();
g_mov_bx(260);
g_mov_ax_BX();
g_pop_dx();
g_push_ax();
g_add_ax_dx();
g_mov_BX_ax();
return;
}
error("Unrecognized primitive");
}
示例5: g_mov_ah_al
int g_mov_ah_al(void) { GEN(0x88); GEN(0xC4); DID(2); }
示例6: g_mov_al_ah
int g_mov_al_ah(void) { GEN(0x88); GEN(0xE0); DID(2); }
示例7: g_add_al
int g_add_al(sbyte s) { GEN(4); GEN(s); DID(2); }
示例8: g_jg
int g_jg(sbyte d) { GEN(0x7F); GEN(d); DID(2); }
示例9: g_shl_ax_1
int g_shl_ax_1(void) { GEN(209); GEN(224); DID(2); }
示例10: g_sub_BX_al
int g_sub_BX_al(void) { GEN(0x28); GEN(7); DID(2); }
示例11: g_add_BX_al
int g_add_BX_al(void) { GEN(0); GEN(7); DID(2); }
示例12: g_sub_BX_ax
int g_sub_BX_ax(void) { GEN(0x29); GEN(7); DID(2); }
示例13: g_add_BX_ax
int g_add_BX_ax(void) { GEN(1); GEN(7); DID(2); }
示例14: g_cmp_al_dl
int g_cmp_al_dl(void) { GEN(0x38); GEN(0xD0); DID(2); }
示例15: g_cmp_dl
int g_cmp_dl(byte q) { GEN(0x80); GEN(0xFA); GEN(q); DID(3); }