39 for(
unsigned int addr = 0; addr <
size ; addr += 2)
48 for(
unsigned int tt = 0; tt <
size; tt++)
56 for(
unsigned int i = 0; i <
size; i++) {
63 for(
unsigned tt = 0; tt < secSize; tt += 2) {
64 if(tt + offset <
size) {
65 assert(tt+offset+1<
size);
66 *(
myMemory + tt + offset) = src[tt + 1];
67 *(
myMemory + tt + 1 + offset) = src[tt];
75 assert(offset <
size);
96 assert(offset <
size);
105 for(; (offset < size) && (secSize > 0); offset += 2, secSize -= 2)
110 assert((
unsigned)addr <
size);
111 assert((addr % 2) == 0);
113 unsigned int index = addr / 2;
137 if(out_instr == NULL)
139 bool is_SPL = (out_instr->
ioreg == 0x3d);
140 bool is_SPH = (out_instr->
ioreg == 0x3e);
141 if(! is_SPH && ! is_SPL)
144 unsigned char out_R = out_instr->
R1;
146 for(
int i = 1; i < 8 && i <= index; i++) {
150 if(out_R == Rlo || (is_SPH && out_R == Rhi)) {
Basic AVR device, contains the core functionality.
virtual unsigned char GetModifiedR() const
If this instruction modifies a R0-R31 register then return its number, otherwise -1.
unsigned int ReadMemWord(unsigned int addr)
void WriteMem(const unsigned char *src, unsigned int addr, unsigned int secSize)
virtual unsigned char GetModifiedRHi() const
If this instruction modifies a pair of R0-R31 registers then ...
AvrFlash(AvrDevice *c, int size)
void WriteMemByte(unsigned char val, unsigned int address)
std::vector< DecodedInstruction * > DecodedMem
bool flashLoaded
Flag, true if there was a write to Flash after constructor call (program load)
DecodedInstruction * GetInstruction(unsigned int pc)
unsigned int rww_lock
When Flash write is in progress then addresses below this are inaccesible, otherwise 0...
bool IsRWWLock(unsigned int addr)
Base class of core instruction.
bool LooksLikeContextSwitch(unsigned int addr) const
unsigned char ReadMem(unsigned int addr)
Hold a memory block and symbol informations.
DecodedInstruction * lookup_opcode(word opcode, AvrDevice *core)
Translates an opcode to a instance of DecodedInstruction.