use of brunonova.drmips.simulator.PseudoInstruction in project drmips by brunonova.
the class DlgSupportedInstructions method setCPU.
/**
* Refreshes the contents of the tables for the specified CPU.
* @param cpu The CPU to get the supported instructions from.
*/
protected final void setCPU(CPU cpu) {
// Instructions
tblInstructions.clear();
for (Instruction i : cpu.getInstructionSet().getInstructions()) tblInstructions.addInstruction(i.getUsage(), i.getDescription());
tblInstructions.packFirstColumn();
// Pseudo-instructions
tblPseudoInstructions.clear();
for (PseudoInstruction i : cpu.getInstructionSet().getPseudoInstructions()) tblPseudoInstructions.addInstruction(i.getUsage(), i.getDescription());
tblPseudoInstructions.packFirstColumn();
}
use of brunonova.drmips.simulator.PseudoInstruction in project drmips by brunonova.
the class DlgCodeHelp method setContents.
private void setContents(View rootView) {
DrMIPSActivity activity = (DrMIPSActivity) getActivity();
TableLayout tblInstructions = (TableLayout) rootView.findViewById(R.id.tblInstructions);
TableLayout tblPseudos = (TableLayout) rootView.findViewById(R.id.tblPseudos);
TableRow row;
TextView inst, desc;
tblInstructions.removeAllViews();
tblPseudos.removeAllViews();
CPU cpu = activity.getCPU();
for (Instruction i : cpu.getInstructionSet().getInstructions()) {
row = new TableRow(activity);
inst = new TextView(activity);
inst.setText(i.getUsage() + " ");
row.addView(inst);
desc = new TextView(activity);
desc.setText("# " + (i.hasDescription() ? i.getDescription() : "-"));
row.addView(desc);
tblInstructions.addView(row);
}
for (PseudoInstruction i : cpu.getInstructionSet().getPseudoInstructions()) {
row = new TableRow(activity);
inst = new TextView(activity);
inst.setText(i.getUsage() + " ");
row.addView(inst);
desc = new TextView(activity);
desc.setText("# " + (i.hasDescription() ? i.getDescription() : "-"));
row.addView(desc);
tblPseudos.addView(row);
}
}
Aggregations