Search in sources :

Example 1 with Instruction

use of brunonova.drmips.simulator.Instruction 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();
}
Also used : PseudoInstruction(brunonova.drmips.simulator.PseudoInstruction) Instruction(brunonova.drmips.simulator.Instruction) PseudoInstruction(brunonova.drmips.simulator.PseudoInstruction)

Example 2 with Instruction

use of brunonova.drmips.simulator.Instruction 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);
    }
}
Also used : PseudoInstruction(brunonova.drmips.simulator.PseudoInstruction) TableRow(android.widget.TableRow) CPU(brunonova.drmips.simulator.CPU) TextView(android.widget.TextView) PseudoInstruction(brunonova.drmips.simulator.PseudoInstruction) Instruction(brunonova.drmips.simulator.Instruction) DrMIPSActivity(brunonova.drmips.android.DrMIPSActivity) TableLayout(android.widget.TableLayout)

Aggregations

Instruction (brunonova.drmips.simulator.Instruction)2 PseudoInstruction (brunonova.drmips.simulator.PseudoInstruction)2 TableLayout (android.widget.TableLayout)1 TableRow (android.widget.TableRow)1 TextView (android.widget.TextView)1 DrMIPSActivity (brunonova.drmips.android.DrMIPSActivity)1 CPU (brunonova.drmips.simulator.CPU)1