simulavr  1.1.0
DecodedInstruction Class Referenceabstract

Base class of core instruction. More...

#include <decoder.h>

Inherited by avr_op_ADC, avr_op_ADD, avr_op_ADIW, avr_op_AND, avr_op_ANDI, avr_op_ASR, avr_op_BCLR, avr_op_BLD, avr_op_BRBC, avr_op_BRBS, avr_op_BREAK, avr_op_BSET, avr_op_BST, avr_op_CALL, avr_op_CBI, avr_op_COM, avr_op_CP, avr_op_CPC, avr_op_CPI, avr_op_CPSE, avr_op_DEC, avr_op_EICALL, avr_op_EIJMP, avr_op_ELPM, avr_op_ELPM_Z, avr_op_ELPM_Z_incr, avr_op_EOR, avr_op_ESPM, avr_op_FMUL, avr_op_FMULS, avr_op_FMULSU, avr_op_ICALL, avr_op_IJMP, avr_op_ILLEGAL, avr_op_IN, avr_op_INC, avr_op_JMP, avr_op_LD_X, avr_op_LD_X_decr, avr_op_LD_X_incr, avr_op_LD_Y_decr, avr_op_LD_Y_incr, avr_op_LD_Z_decr, avr_op_LD_Z_incr, avr_op_LDD_Y, avr_op_LDD_Z, avr_op_LDI, avr_op_LDS, avr_op_LPM, avr_op_LPM_Z, avr_op_LPM_Z_incr, avr_op_LSR, avr_op_MOV, avr_op_MOVW, avr_op_MUL, avr_op_MULS, avr_op_MULSU, avr_op_NEG, avr_op_NOP, avr_op_OR, avr_op_ORI, avr_op_OUT, avr_op_POP, avr_op_PUSH, avr_op_RCALL, avr_op_RET, avr_op_RETI, avr_op_RJMP, avr_op_ROR, avr_op_SBC, avr_op_SBCI, avr_op_SBI, avr_op_SBIC, avr_op_SBIS, avr_op_SBIW, avr_op_SBRC, avr_op_SBRS, avr_op_SLEEP, avr_op_SPM, avr_op_ST_X, avr_op_ST_X_decr, avr_op_ST_X_incr, avr_op_ST_Y_decr, avr_op_ST_Y_incr, avr_op_ST_Z_decr, avr_op_ST_Z_incr, avr_op_STD_Y, avr_op_STD_Z, avr_op_STS, avr_op_SUB, avr_op_SUBI, avr_op_SWAP, and avr_op_WDR.

Public Member Functions

 DecodedInstruction (AvrDevice *c, bool s2w=false)
 
virtual ~DecodedInstruction ()
 
bool IsInstruction2Words ()
 Returns true, if instruction need 2 words (4byte) More...
 
virtual int operator() ()=0
 Performs instruction. More...
 
virtual int Trace ()=0
 Performs instruction and write out instruction mnemonic for trace. More...
 
virtual unsigned char GetModifiedR () const
 If this instruction modifies a R0-R31 register then return its number, otherwise -1. More...
 
virtual unsigned char GetModifiedRHi () const
 If this instruction modifies a pair of R0-R31 registers then ... More...
 

Protected Attributes

AvrDevicecore
 Link to device instance. More...
 
bool size2Word
 Flag: true, if instruction has 2 words. More...
 

Detailed Description

Base class of core instruction.

All instruction are derived from this class

Definition at line 39 of file decoder.h.

Constructor & Destructor Documentation

◆ DecodedInstruction()

DecodedInstruction::DecodedInstruction ( AvrDevice c,
bool  s2w = false 
)
inline

Definition at line 46 of file decoder.h.

◆ ~DecodedInstruction()

virtual DecodedInstruction::~DecodedInstruction ( )
inlinevirtual

Definition at line 47 of file decoder.h.

Member Function Documentation

◆ GetModifiedR()

virtual unsigned char DecodedInstruction::GetModifiedR ( ) const
inlinevirtual

If this instruction modifies a R0-R31 register then return its number, otherwise -1.

Reimplemented in avr_op_SUBI, avr_op_SUB, avr_op_SBIW, avr_op_SBCI, avr_op_SBC, avr_op_LDI, avr_op_ADIW, avr_op_ADD, and avr_op_ADC.

Definition at line 57 of file decoder.h.

Referenced by AvrFlash::LooksLikeContextSwitch().

◆ GetModifiedRHi()

virtual unsigned char DecodedInstruction::GetModifiedRHi ( ) const
inlinevirtual

If this instruction modifies a pair of R0-R31 registers then ...

Reimplemented in avr_op_SBIW, and avr_op_ADIW.

Definition at line 59 of file decoder.h.

References core, and lookup_opcode().

Referenced by AvrFlash::LooksLikeContextSwitch().

◆ IsInstruction2Words()

bool DecodedInstruction::IsInstruction2Words ( )
inline

Returns true, if instruction need 2 words (4byte)

Definition at line 50 of file decoder.h.

References operator()(), size2Word, and Trace().

◆ operator()()

◆ Trace()

Member Data Documentation

◆ core

AvrDevice* DecodedInstruction::core
protected

Link to device instance.

Definition at line 42 of file decoder.h.

Referenced by GetModifiedRHi(), avr_op_ADC::operator()(), avr_op_ADD::operator()(), avr_op_ADIW::operator()(), avr_op_AND::operator()(), avr_op_ANDI::operator()(), avr_op_ASR::operator()(), avr_op_BLD::operator()(), avr_op_BRBC::operator()(), avr_op_BRBS::operator()(), avr_op_BST::operator()(), avr_op_CALL::operator()(), avr_op_CBI::operator()(), avr_op_COM::operator()(), avr_op_CP::operator()(), avr_op_CPC::operator()(), avr_op_CPI::operator()(), avr_op_CPSE::operator()(), avr_op_DEC::operator()(), avr_op_EICALL::operator()(), avr_op_EIJMP::operator()(), avr_op_ELPM_Z::operator()(), avr_op_ELPM_Z_incr::operator()(), avr_op_ELPM::operator()(), avr_op_EOR::operator()(), avr_op_ESPM::operator()(), avr_op_FMUL::operator()(), avr_op_FMULS::operator()(), avr_op_FMULSU::operator()(), avr_op_ICALL::operator()(), avr_op_IJMP::operator()(), avr_op_IN::operator()(), avr_op_INC::operator()(), avr_op_JMP::operator()(), avr_op_LDD_Y::operator()(), avr_op_LDD_Z::operator()(), avr_op_LDI::operator()(), avr_op_LDS::operator()(), avr_op_LD_X::operator()(), avr_op_LD_X_decr::operator()(), avr_op_LD_X_incr::operator()(), avr_op_LD_Y_decr::operator()(), avr_op_LD_Y_incr::operator()(), avr_op_LD_Z_incr::operator()(), avr_op_LD_Z_decr::operator()(), avr_op_LPM_Z::operator()(), avr_op_LPM::operator()(), avr_op_LPM_Z_incr::operator()(), avr_op_LSR::operator()(), avr_op_MOV::operator()(), avr_op_MOVW::operator()(), avr_op_MUL::operator()(), avr_op_MULS::operator()(), avr_op_MULSU::operator()(), avr_op_NEG::operator()(), avr_op_OR::operator()(), avr_op_ORI::operator()(), avr_op_OUT::operator()(), avr_op_POP::operator()(), avr_op_PUSH::operator()(), avr_op_RCALL::operator()(), avr_op_RET::operator()(), avr_op_RETI::operator()(), avr_op_RJMP::operator()(), avr_op_ROR::operator()(), avr_op_SBC::operator()(), avr_op_SBCI::operator()(), avr_op_SBI::operator()(), avr_op_SBIC::operator()(), avr_op_SBIS::operator()(), avr_op_SBIW::operator()(), avr_op_SBRC::operator()(), avr_op_SBRS::operator()(), avr_op_SLEEP::operator()(), avr_op_SPM::operator()(), avr_op_STD_Y::operator()(), avr_op_STD_Z::operator()(), avr_op_STS::operator()(), avr_op_ST_X::operator()(), avr_op_ST_X_decr::operator()(), avr_op_ST_X_incr::operator()(), avr_op_ST_Y_decr::operator()(), avr_op_ST_Y_incr::operator()(), avr_op_ST_Z_decr::operator()(), avr_op_ST_Z_incr::operator()(), avr_op_SUB::operator()(), avr_op_SUBI::operator()(), avr_op_SWAP::operator()(), avr_op_WDR::operator()(), and avr_op_ILLEGAL::operator()().

◆ size2Word

bool DecodedInstruction::size2Word
protected

Flag: true, if instruction has 2 words.

Definition at line 43 of file decoder.h.

Referenced by IsInstruction2Words().


The documentation for this class was generated from the following file: