SimAVR
AVR Simulator
Core Simulation

Macros

#define DUMP_STACK()
 
#define DUMP_REG()   ;
 
#define READ_SREG_INTO(avr, dst)
 Reconstructs the SREG value from avr->sreg into dst. More...
 
#define SET_SREG_FROM(avr, src)
 Splits the SREG value from src into the avr->sreg array. More...
 

Functions

avr_flashaddr_t avr_run_one (avr_t *avr)
 Instruction decoder, run ONE instruction. More...
 
uint16_t _avr_sp_get (avr_t *avr)
 Stack pointer access. More...
 
void _avr_sp_set (avr_t *avr, uint16_t sp)
 
int _avr_push_addr (avr_t *avr, avr_flashaddr_t addr)
 
static void avr_sreg_set (avr_t *avr, uint8_t flag, uint8_t ival)
 clear interrupt_state if disabling interrupts. More...
 

Detailed Description

Macro Definition Documentation

#define DUMP_REG ( )    ;
#define DUMP_STACK ( )
#define READ_SREG_INTO (   avr,
  dst 
)
Value:
{ \
dst = 0; \
for (int i = 0; i < 8; i++) \
if (avr->sreg[i] > 1) \
printf("** Invalid SREG!!\n"); \
else if (avr->sreg[i]) \
dst |= (1 << i); \
}
avr_t * avr
Definition: run_avr.c:54
uint8_t sreg[8]
Mirror of the SREG register, to facilitate the access to bits in the opcode decoder.
Definition: sim_avr.h:207

Reconstructs the SREG value from avr->sreg into dst.

#define SET_SREG_FROM (   avr,
  src 
)
Value:
{ \
for (int i = 0; i < 8; i++) \
avr_sreg_set(avr, i, (src & (1 << i)) != 0); \
}
avr_t * avr
Definition: run_avr.c:54
static void avr_sreg_set(avr_t *avr, uint8_t flag, uint8_t ival)
clear interrupt_state if disabling interrupts.
Definition: sim_core.h:102

Splits the SREG value from src into the avr->sreg array.

Function Documentation

int _avr_push_addr ( avr_t avr,
avr_flashaddr_t  addr 
)

Here is the call graph for this function:

Here is the caller graph for this function:

uint16_t _avr_sp_get ( avr_t avr)
inline

Stack pointer access.

Here is the caller graph for this function:

void _avr_sp_set ( avr_t avr,
uint16_t  sp 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

avr_flashaddr_t avr_run_one ( avr_t avr)

Instruction decoder, run ONE instruction.

Here is the call graph for this function:

Here is the caller graph for this function:

static void avr_sreg_set ( avr_t avr,
uint8_t  flag,
uint8_t  ival 
)
inlinestatic

clear interrupt_state if disabling interrupts.

set wait if enabling interrupts. no change if interrupt flag does not change.

Here is the caller graph for this function: