avrora.sim.mcu
Class ReprogrammableCodeSegment.DisassembleInstr

java.lang.Object
  extended byavrora.core.Instr
      extended byavrora.sim.mcu.ReprogrammableCodeSegment.DisassembleInstr
All Implemented Interfaces:
InstrPrototype
Enclosing class:
ReprogrammableCodeSegment

public class ReprogrammableCodeSegment.DisassembleInstr
extends Instr

The DisasssembleInstr class represents an instruction that is used by the interpreter to support dynamic code update. Whenever machine code is altered, this instruction will replace the instruction(s) at that location so that when the program attempts to execute the instruction, it will first be disassembled and then it will be executed.


Nested Class Summary
 
Nested classes inherited from class avrora.core.Instr
Instr.ADC, Instr.ADD, Instr.ADIW, Instr.AND, Instr.ANDI, Instr.ASR, Instr.BCLR, Instr.BLD, Instr.BRBC, Instr.BRBS, Instr.BRCC, Instr.BRCS, Instr.BREAK, Instr.BREQ, Instr.BRGE, Instr.BRHC, Instr.BRHS, Instr.BRID, Instr.BRIE, Instr.BRLO, Instr.BRLT, Instr.BRMI, Instr.BRNE, Instr.BRPL, Instr.BRSH, Instr.BRTC, Instr.BRTS, Instr.BRVC, Instr.BRVS, Instr.BSET, Instr.BST, Instr.CALL, Instr.CBI, Instr.CBR, Instr.CLC, Instr.CLH, Instr.CLI, Instr.CLN, Instr.CLR, Instr.CLS, Instr.CLT, Instr.CLV, Instr.CLZ, Instr.COM, Instr.CP, Instr.CPC, Instr.CPI, Instr.CPSE, Instr.DEC, Instr.EICALL, Instr.EIJMP, Instr.ELPM, Instr.ELPMD, Instr.ELPMPI, Instr.EOR, Instr.FMUL, Instr.FMULS, Instr.FMULSU, Instr.ICALL, Instr.IJMP, Instr.IMM_class, Instr.ImmediateRequired, Instr.IMMIMM_class, Instr.IMMREG_class, Instr.IMMWORD_class, Instr.IN, Instr.INC, Instr.InvalidImmediate, Instr.InvalidOperand, Instr.InvalidRegister, Instr.JMP, Instr.LD, Instr.LDD, Instr.LDI, Instr.LDPD, Instr.LDPI, Instr.LDS, Instr.LPM, Instr.LPMD, Instr.LPMPI, Instr.LSL, Instr.LSR, Instr.MOV, Instr.MOVW, Instr.MUL, Instr.MULS, Instr.MULSU, Instr.NEG, Instr.NONE_class, Instr.NOP, Instr.OR, Instr.ORI, Instr.OUT, Instr.POP, Instr.PUSH, Instr.RCALL, Instr.REG_class, Instr.REGIMM_class, Instr.REGIMMREG_class, Instr.RegisterRequired, Instr.REGREG_class, Instr.REGREGIMM_class, Instr.RET, Instr.RETI, Instr.RJMP, Instr.ROL, Instr.ROR, Instr.SBC, Instr.SBCI, Instr.SBI, Instr.SBIC, Instr.SBIS, Instr.SBIW, Instr.SBR, Instr.SBRC, Instr.SBRS, Instr.SEC, Instr.SEH, Instr.SEI, Instr.SEN, Instr.SER, Instr.SES, Instr.SET, Instr.SEV, Instr.SEZ, Instr.SLEEP, Instr.SPM, Instr.ST, Instr.STD, Instr.STPD, Instr.STPI, Instr.STS, Instr.SUB, Instr.SUBI, Instr.SWAP, Instr.TST, Instr.WDR, Instr.WORD_class, Instr.WrongNumberOfOperands
 
Field Summary
protected  int address
           
 
Fields inherited from class avrora.core.Instr
properties
 
Method Summary
 void accept(InstrVisitor v)
          The accept() method is part of the visitor pattern for instructions.
 Instr asInstr()
          The asInstr() method converts an instruction into an AVR instruction.
 Instr build(int address, Operand[] ops)
          The build() method constructs a new Instr instance with the given operands, checking the operands against the constraints that are specific to each instruction.
 java.lang.String getOperands()
          The getOperands() method returns a string representation of the operands of the instruction.
 
Methods inherited from class avrora.core.Instr
getCycles, getName, getSize, getVariant, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

address

protected final int address
Method Detail

accept

public void accept(InstrVisitor v)
Description copied from class: Instr
The accept() method is part of the visitor pattern for instructions. The visitor pattern uses two virtual dispatches combined with memory overloading to achieve dispatching on multiple types. The result is clean and modular code.

Specified by:
accept in class Instr
Parameters:
v - the visitor to accept

build

public Instr build(int address,
                   Operand[] ops)
Description copied from interface: InstrPrototype
The build() method constructs a new Instr instance with the given operands, checking the operands against the constraints that are specific to each instruction.

Parameters:
address - the address at which the instruction will be located
ops - the operands to the instruction
Returns:
a new Instr instance representing the instruction with the given operands

getOperands

public java.lang.String getOperands()
Description copied from class: Instr
The getOperands() method returns a string representation of the operands of the instruction. This is useful for printing and tracing of instructions as well as generating listings.

Specified by:
getOperands in class Instr
Returns:
a string representing the operands of the instruction

asInstr

public Instr asInstr()
Description copied from class: Instr
The asInstr() method converts an instruction into an AVR instruction. This is used internally for special types of instructions (that are used in the interpreter, for example) so that they behave correctly when reading them from an executing program.

Overrides:
asInstr in class Instr
Returns:
an object representing this instruction that is one of the valid AVR instructions; null if this instruction is a "special" type of instruction such as those used internally in the interpreter