本文整理汇总了C++中AsmCode::AddCmd方法的典型用法代码示例。如果您正苦于以下问题:C++ AsmCode::AddCmd方法的具体用法?C++ AsmCode::AddCmd怎么用?C++ AsmCode::AddCmd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AsmCode
的用法示例。
在下文中一共展示了AsmCode::AddCmd方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GenerateValue
void SymVarConst::GenerateValue(AsmCode& asm_code) const
{
if (value.GetType() == INT_CONST)
{
asm_code.AddCmd(ASM_PUSH, value.GetIntValue());
}
else if (value.GetType() == REAL_CONST)
{
stringstream s;
s << value.GetName();
float f;
int* p = (int*)&f;
s >> f;
asm_code.AddCmd(ASM_PUSH, *p);
}
示例2: Generate
void SymVarGlobal::Generate(AsmCode& asmCode, unsigned) const
{
if (type->GetSize() > 4) {
GenerateLValue(asmCode, 0);
asmCode.PushMemory(type->GetSize());
} else {
asmCode.AddCmd(PUSH, AsmMemory(varLabel, 0, szDWORD));
}
}
示例3: GenerateDeclaration
void SymProc::GenerateDeclaration(AsmCode& asm_code)
{
if (IsDummyProc()) return;
asm_code.AddLabel(label);
asm_code.AddCmd(ASM_PUSH, REG_EBP);
asm_code.AddCmd(ASM_MOV, REG_ESP, REG_EBP);
if (sym_table->GetLocalsSize()) asm_code.AddCmd(ASM_SUB, sym_table->GetLocalsSize(), REG_ESP);
body->Generate(asm_code);
asm_code.AddLabel(exit_label);
asm_code.AddCmd(ASM_MOV, REG_EBP, REG_ESP);
asm_code.AddCmd(ASM_POP, REG_EBP);
asm_code.AddCmd(ASM_RET, sym_table->GetParamsSize() - GetResultType()->GetSize());
}
示例4: GenerateLValue
void SymVarGlobal::GenerateLValue(AsmCode& asmCode, unsigned) const
{
asmCode.AddCmd(PUSH, AsmVarAddr(varLabel));
}