--- trunk/src/include/cpu_avr.h 2007/10/08 16:19:37 22 +++ trunk/src/include/cpu_avr.h 2007/10/08 16:19:56 24 @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * - * $Id: cpu_avr.h,v 1.14 2006/02/09 22:40:27 debug Exp $ + * $Id: cpu_avr.h,v 1.16 2006/03/04 11:20:43 debug Exp $ */ #include "misc.h" @@ -38,7 +38,7 @@ #define N_AVR_REGS 32 -#define AVR_N_IC_ARGS 3 +#define AVR_N_IC_ARGS 4 #define AVR_INSTR_ALIGNMENT_SHIFT 1 #define AVR_IC_ENTRIES_SHIFT 11 #define AVR_IC_ENTRIES_PER_PAGE (1 << AVR_IC_ENTRIES_SHIFT) @@ -63,9 +63,14 @@ #define AVR_SREG_T 0x40 /* Transfer bit */ #define AVR_SREG_I 0x80 /* Interrupt enable/disable */ +#define AVR_SRAM_BASE 0x800000 + struct avr_cpu { uint32_t pc_mask; + int is_22bit; /* 0 for 16-bit, 1 for 22-bit PC */ + + uint32_t sram_mask; /* * General Purpose Registers: @@ -75,6 +80,23 @@ /* Status register: */ uint8_t sreg; + /* Ports A-D: */ + uint8_t ddra; /* Direction */ + uint8_t ddrb; + uint8_t ddrc; + uint8_t ddrd; + uint8_t porta_read; + uint8_t porta_write; + uint8_t portb_read; + uint8_t portb_write; + uint8_t portc_read; + uint8_t portc_write; + uint8_t portd_read; + uint8_t portd_write; + + /* Stack pointer (high and low byte combined): */ + uint16_t sp; + /* * In order to keep an accurate cycle count, this variable should be * increased for those instructions that take longer than 1 cycle to