本文整理汇总了C++中Assembly::WriteDword方法的典型用法代码示例。如果您正苦于以下问题:C++ Assembly::WriteDword方法的具体用法?C++ Assembly::WriteDword怎么用?C++ Assembly::WriteDword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assembly
的用法示例。
在下文中一共展示了Assembly::WriteDword方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseLine
bool Assembler::ParseLine(string& line, int linecount, Assembly& assembly, LabelVector& labels)
{
string op;
int i = NextWord(line, op);
// skip commented and empty lines
if(i == -1 || op == "//" || op == ";") return true;
// this is a a very slow way of doing things, but then this code will only
// be used during development and for debugging
OpDesc *opcode;
int codecount = sizeof(opcodes)/sizeof(OpDesc);
int j = 0;
for(; j < codecount; j ++) {
if(stricmp(opcodes[j].name, op.c_str()) == 0) {
opcode = &opcodes[j];
break;
}
}
// is this a label?
if(j == codecount) {
size_t k = op.length() - 1;
if(op.find_first_of(":") == k) {
string name = op.substr(0, k);
labels.at(AddLabel(name, labels)).pos = assembly.curpos;
return true;
} else
return false;
} else {
assembly.WriteDword(opcode->code);
string param;
i = NextWord(line, param, i);
if(IsJumpOp(opcode->code)) {
// write the label index, we'll later replace this with the code position
assembly.WriteDword(AddLabel(param, labels));
} else {
if(i == -1) {
assembly.WriteDword(0);
if(opcode->paramcount > 0) return false; // if we need more params, bail
} else
assembly.WriteDword(StringToOperand(param, opcode));
}
}
return true;
}