Fixed problem in DeviceSettings::strParam, returned wrong string
[avr-sim.git] / src / Decoder.h
bloba0a4ccafaf2a2615e922e8a043e45cca04741819
1 #ifndef AVR_DECODER_H
2 #define AVR_DECODER_H
4 #include <vector>
5 #include "Types.h"
7 namespace avr {
9 class Instruction;
11 /**
12 * @author Tom Haber
13 * @date Apr 23, 2008
14 * @brief Instruction Decoder
16 * The decoder can decode instruction opcodes and returns
17 * Instruction classes capable of executing the instruction.
19 * For performance reasons, it contains a big table with all
20 * possible opcodes and accompanying Instruction instance.
22 class Decoder {
23 public:
24 Decoder();
25 ~Decoder();
27 public:
28 Instruction & decode( word opcode ) const;
29 bool is2WordInstruction( word opcode ) const;
31 private:
32 Instruction *lookupOpcode( word opcode );
34 private:
35 std::vector<Instruction *> lut;
38 inline Instruction & Decoder::decode( word opcode ) const {
39 return *lut[opcode];
44 #endif /*AVR_DECODER_H*/