Introduce MachineAssemblyObject

This commit is contained in:
Alex Beregszaszi
2017-06-09 16:40:14 +02:00
committed by chriseth
parent fe3b46554a
commit f0d213e6b5
3 changed files with 23 additions and 6 deletions
+6 -1
View File
@@ -1082,9 +1082,10 @@ bool CommandLineInterface::assemble(
"eWasm";
cout << endl << "======= " << src.first << " (" << machine << ") =======" << endl;
AssemblyStack& stack = assemblyStacks[src.first];
MachineAssemblyObject object;
try
{
cout << stack.assemble(_targetMachine).toHex() << endl;
object = stack.assemble(_targetMachine);
}
catch (Exception const& _exception)
{
@@ -1096,6 +1097,10 @@ bool CommandLineInterface::assemble(
cerr << "Unknown exception while assembling." << endl;
return false;
}
if (object.bytecode)
cout << object.bytecode->toHex() << endl;
else
cerr << "No binary representation found." << endl;
cout << stack.print() << endl;
}