/home/thomas/development/delivery-check/repo/src/decoder.cpp File Reference

#include "decoder.h"
#include "hwstack.h"
#include "flash.h"
#include "hwwado.h"
#include "hwsreg.h"
#include "global.h"
#include "avrerror.h"
#include "ioregs.h"
Include dependency graph for decoder.cpp:

Go to the source code of this file.

Enumerations

enum  decoder_operand_masks {
  mask_Rd_2 = 0x0030, mask_Rd_3 = 0x0070, mask_Rd_4 = 0x00f0, mask_Rd_5 = 0x01f0,
  mask_Rr_3 = 0x0007, mask_Rr_4 = 0x000f, mask_Rr_5 = 0x020f, mask_K_8 = 0x0F0F,
  mask_K_6 = 0x00CF, mask_k_7 = 0x03F8, mask_k_12 = 0x0FFF, mask_k_22 = 0x01F1,
  mask_reg_bit = 0x0007, mask_sreg_bit = 0x0070, mask_q_displ = 0x2C07, mask_A_5 = 0x00F8,
  mask_A_6 = 0x060F
}

Functions

static int n_bit_unsigned_to_signed (unsigned int val, int n)
static int get_add_carry (byte res, byte rd, byte rr, int b)
static int get_add_overflow (byte res, byte rd, byte rr)
static int get_sub_carry (byte res, byte rd, byte rr, int b)
static int get_sub_overflow (byte res, byte rd, byte rr)
static int get_compare_carry (byte res, byte rd, byte rr, int b)
static int get_compare_overflow (byte res, byte rd, byte rr)
static int get_rd_2 (word opcode)
static int get_rd_3 (word opcode)
static int get_rd_4 (word opcode)
static int get_rd_5 (word opcode)
static int get_rr_3 (word opcode)
static int get_rr_4 (word opcode)
static int get_rr_5 (word opcode)
static byte get_K_8 (word opcode)
static byte get_K_6 (word opcode)
static int get_k_7 (word opcode)
static int get_k_12 (word opcode)
static int get_k_22 (word opcode)
static int get_reg_bit (word opcode)
static int get_sreg_bit (word opcode)
static int get_q (word opcode)
static int get_A_5 (word opcode)
static int get_A_6 (word opcode)
DecodedInstructionlookup_opcode (word opcode, AvrDevice *core)
 Translates an opcode to a instance of DecodedInstruction.

Enumeration Type Documentation

Enumerator:
mask_Rd_2 

2 bit register id ( R24, R26, R28, R30 )

mask_Rd_3 

3 bit register id ( R16 - R23 )

mask_Rd_4 

4 bit register id ( R16 - R31 )

mask_Rd_5 

5 bit register id ( R00 - R31 )

mask_Rr_3 

3 bit register id ( R16 - R23 )

mask_Rr_4 

4 bit register id ( R16 - R31 )

mask_Rr_5 

5 bit register id ( R00 - R31 )

mask_K_8 

for 8 bit constant

mask_K_6 

for 6 bit constant

mask_k_7 

for 7 bit relative address

mask_k_12 

for 12 bit relative address

mask_k_22 

for 22 bit absolute address

mask_reg_bit 

register bit select

mask_sreg_bit 

status register bit select

mask_q_displ 

address displacement (q)

mask_A_5 

5 bit register id ( R00 - R31 )

mask_A_6 

6 bit IO port id

Definition at line 44 of file decoder.cpp.


Function Documentation

static int get_A_5 ( word  opcode  )  [static]

Definition at line 1941 of file decoder.cpp.

References mask_A_5.

static int get_A_6 ( word  opcode  )  [static]

Definition at line 1946 of file decoder.cpp.

References mask_A_6.

static int get_add_carry ( byte  res,
byte  rd,
byte  rr,
int  b 
) [static]

Definition at line 1787 of file decoder.cpp.

Referenced by avr_op_ADD::operator()(), and avr_op_ADC::operator()().

Here is the caller graph for this function:

static int get_add_overflow ( byte  res,
byte  rd,
byte  rr 
) [static]

Definition at line 1795 of file decoder.cpp.

Referenced by avr_op_ADD::operator()(), and avr_op_ADC::operator()().

Here is the caller graph for this function:

static int get_compare_carry ( byte  res,
byte  rd,
byte  rr,
int  b 
) [static]

Definition at line 1819 of file decoder.cpp.

Referenced by avr_op_CPI::operator()(), avr_op_CPC::operator()(), and avr_op_CP::operator()().

Here is the caller graph for this function:

static int get_compare_overflow ( byte  res,
byte  rd,
byte  rr 
) [static]

Definition at line 1827 of file decoder.cpp.

Referenced by avr_op_CPI::operator()(), avr_op_CPC::operator()(), and avr_op_CP::operator()().

Here is the caller graph for this function:

static int get_k_12 ( word  opcode  )  [static]

Definition at line 1907 of file decoder.cpp.

References mask_k_12.

static int get_k_22 ( word  opcode  )  [static]

Definition at line 1912 of file decoder.cpp.

References mask_k_22.

static byte get_K_6 ( word  opcode  )  [static]

Definition at line 1896 of file decoder.cpp.

References mask_K_6.

static int get_k_7 ( word  opcode  )  [static]

Definition at line 1902 of file decoder.cpp.

References mask_k_7.

static byte get_K_8 ( word  opcode  )  [static]

Definition at line 1890 of file decoder.cpp.

References mask_K_8.

static int get_q ( word  opcode  )  [static]

Definition at line 1933 of file decoder.cpp.

References mask_q_displ.

static int get_rd_2 ( word  opcode  )  [static]

Definition at line 1850 of file decoder.cpp.

References mask_Rd_2.

static int get_rd_3 ( word  opcode  )  [static]

Definition at line 1856 of file decoder.cpp.

References mask_Rd_3.

static int get_rd_4 ( word  opcode  )  [static]

Definition at line 1862 of file decoder.cpp.

References mask_Rd_4.

static int get_rd_5 ( word  opcode  )  [static]

Definition at line 1868 of file decoder.cpp.

References mask_Rd_5.

static int get_reg_bit ( word  opcode  )  [static]

Definition at line 1923 of file decoder.cpp.

References mask_reg_bit.

static int get_rr_3 ( word  opcode  )  [static]

Definition at line 1874 of file decoder.cpp.

References mask_Rr_3.

static int get_rr_4 ( word  opcode  )  [static]

Definition at line 1879 of file decoder.cpp.

References mask_Rr_4.

static int get_rr_5 ( word  opcode  )  [static]

Definition at line 1884 of file decoder.cpp.

References mask_Rr_5.

static int get_sreg_bit ( word  opcode  )  [static]

Definition at line 1928 of file decoder.cpp.

References mask_sreg_bit.

static int get_sub_carry ( byte  res,
byte  rd,
byte  rr,
int  b 
) [static]

Definition at line 1803 of file decoder.cpp.

Referenced by avr_op_SUBI::operator()(), avr_op_SUB::operator()(), avr_op_SBCI::operator()(), and avr_op_SBC::operator()().

Here is the caller graph for this function:

static int get_sub_overflow ( byte  res,
byte  rd,
byte  rr 
) [static]

Definition at line 1811 of file decoder.cpp.

Referenced by avr_op_SUBI::operator()(), avr_op_SUB::operator()(), avr_op_SBCI::operator()(), and avr_op_SBC::operator()().

Here is the caller graph for this function:

DecodedInstruction* lookup_opcode ( word  opcode,
AvrDevice core 
)
static int n_bit_unsigned_to_signed ( unsigned int  val,
int  n 
) [static]

Definition at line 1836 of file decoder.cpp.

Generated on Sun Feb 12 16:44:05 2012 for Simulavr by  doxygen 1.6.3