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 | |
int | avr_op_UNKNOWN (AvrCore *core, uint16_t opcode, unsigned int arg1, unsigned int arg2) |
void | decode_init_lookup_table (void) |
opcode_info * | decode_opcode (uint16_t opcode) |
Variables | |
opcode_info * | global_opcode_lookup_table |
The heart of the instruction decoder is the decode_opcode() function.
The decode_opcode() function examines the given opcode to determine which instruction applies and returns a pointer to a function to handler performing the instruction's operation. If the given opcode does not map to an instruction handler, NULL is returned.
Nearly every instruction in Atmel's Instruction Set Data Sheet will have a handler function defined. Each handler will perform all the operations described in the data sheet for a given instruction. A few instructions have synonyms. For example, CBR is a synonym for ANDI.
This should all be fairly straight forward.
Definition in file decoder.c.
Masks to help extracting information from opcodes.
void decode_init_lookup_table | ( | void | ) |
Initialize the decoder lookup table.
This is automatically called by avr_core_construct().
It is safe to call this function many times, since if will only create the table the first time it is called.
Definition at line 3869 of file decoder.c.
References avr_message, avr_new0, and global_opcode_lookup_table.
struct opcode_info* decode_opcode | ( | uint16_t | opcode | ) |
Decode an opcode into the opcode handler function.
Generates a warning and returns NULL if opcode is invalid.
Returns a pointer to the function to handle the opcode.