Bug fix: check if vm exists
[avr-sim.git] / Instructions.h
blob01772158740f42fb58885f2842e36b594233fc8d
1 #ifndef AVR_INSTRUCTIONS_H
2 #define AVR_INSTRUCTIONS_H
4 #include "Instruction.h"
5 #include "Types.h"
7 #include <iostream>
9 namespace avr {
11 class Register;
12 class Core;
14 namespace op {
16 class ADC : public Instruction {
18 * Add with Carry.
20 * Opcode : 0001 11rd dddd rrrr
21 * Usage : ADC Rd, Rr
22 * Operation : Rd <- Rd + Rr + C
23 * Flags : Z,C,N,V,S,H
24 * Num Clocks : 1
27 public:
28 ADC(word opcode);
30 public:
31 int operator()(Core *core);
32 int trace(Core *core, std::ostream & ostr);
34 protected:
35 unsigned char Rd;
36 unsigned char Rr;
37 unsigned char S;
41 class ADD : public Instruction {
43 * Add without Carry.
45 * Opcode : 0000 11rd dddd rrrr
46 * Usage : ADD Rd, Rr
47 * Operation : Rd <- Rd + Rr
48 * Flags : Z,C,N,V,S,H
49 * Num Clocks : 1
52 public:
53 ADD(word opcode);
55 public:
56 int operator ()(Core *core);
57 int trace(Core *core, std::ostream & ostr);
59 protected:
60 unsigned char Rd;
61 unsigned char Rr;
62 unsigned char S;
65 class ADIW : public Instruction {
67 * Add Immediate to Word.
69 * Opcode : 1001 0110 KKdd KKKK
70 * Usage : ADIW Rd, K
71 * Operation : Rd+1:Rd <- Rd+1:Rd + K
72 * Flags : Z,C,N,V,S
73 * Num Clocks : 2
76 public:
77 ADIW(word opcode);
79 public:
80 int operator ()(Core *core);
81 int trace(Core *core, std::ostream & ostr);
83 protected:
84 unsigned char Rl;
85 unsigned char Rh;
86 unsigned char K;
87 unsigned char S;
90 class AND : public Instruction {
92 * Logical AND.
94 * Opcode : 0010 00rd dddd rrrr
95 * Usage : AND Rd, Rr
96 * Operation : Rd <- Rd & Rr
97 * Flags : Z,N,V,S
98 * Num Clocks : 1
101 public:
102 AND(word opcode);
104 public:
105 int operator()(Core *core);
106 int trace(Core *core, std::ostream & ostr);
108 protected:
109 unsigned char Rd;
110 unsigned char Rr;
111 unsigned char S;
114 class ANDI : public Instruction {
116 * Logical AND with Immed.
118 * Opcode : 0111 KKKK dddd KKKK
119 * Usage : ANDI Rd, K
120 * Operation : Rd <- Rd & K
121 * Flags : Z,N,V,S
122 * Num Clocks : 1
125 public:
126 ANDI(word opcode);
128 public:
129 int operator()(Core *core);
130 int trace(Core *core, std::ostream & ostr);
132 protected:
133 unsigned char Rd;
134 unsigned char K;
135 unsigned char S;
138 class ASR : public Instruction {
140 * Arithmetic Shift Right.
142 * Opcode : 1001 010d dddd 0101
143 * Usage : ASR Rd
144 * Operation : Rd(n) <- Rd(n+1), n=0..6
145 * Flags : Z,C,N,V,S
146 * Num Clocks : 1
149 public:
150 ASR(word opcode);
152 public:
153 int operator()(Core *core);
154 int trace(Core *core, std::ostream & ostr);
156 protected:
157 unsigned char Rd;
158 unsigned char S;
161 class BCLR : public Instruction {
163 * Clear a single flag or bit in SREG.
165 * Opcode : 1001 0100 1sss 1000
166 * Usage : BCLR
167 * Operation : SREG(s) <- 0
168 * Flags : SREG(s)
169 * Num Clocks : 1
172 public:
173 BCLR(word opcode);
175 public:
176 int operator()(Core *core);
177 int trace(Core *core, std::ostream & ostr);
179 protected:
180 unsigned char K;
181 unsigned char S;
184 class BLD : public Instruction {
185 /* Bit load from T to Register.
187 * Opcode : 1111 100d dddd 0bbb
188 * Usage : BLD Rd, b
189 * Operation : Rd(b) <- T
190 * Flags : None
191 * Num Clocks : 1
194 public:
195 BLD(word opcode);
197 public:
198 int operator()(Core *core);
199 int trace(Core *core, std::ostream & ostr);
201 protected:
202 unsigned char Rd;
203 unsigned char Kadd, Kremove;
204 unsigned char S;
207 class BRBC : public Instruction {
209 * Branch if Status Flag Cleared.
211 * Pass control directly to the specific bit operation.
213 * Opcode : 1111 01kk kkkk ksss
214 * Usage : BRBC s, k
215 * Operation : if (SREG(s) = 0) then PC <- PC + k + 1
216 * Flags : None
217 * Num Clocks : 1 / 2
219 * k is an relative address represented in two's complements.
220 * (64 < k <= 64)
223 public:
224 BRBC(word opcode);
226 public:
227 int operator()(Core *core);
228 int trace(Core *core, std::ostream & ostr);
230 protected:
231 unsigned char bitmask;
232 signed char offset;
233 unsigned char S;
236 class BRBS : public Instruction {
238 * Branch if Status Flag Set.
240 * Pass control directly to the specific bit operation.
242 * Opcode : 1111 00kk kkkk ksss
243 * Usage : BRBS s, k
244 * Operation : if (SREG(s) = 1) then PC <- PC + k + 1
245 * Flags : None
246 * Num Clocks : 1 / 2
248 * k is an relative address represented in two's complements.
249 * (64 < k <= 64)
252 public:
253 BRBS(word opcode);
255 public:
256 int operator()(Core *core);
257 int trace(Core *core, std::ostream & ostr);
259 protected:
260 unsigned char bitmask;
261 signed char offset;
262 unsigned char S;
265 class BSET : public Instruction {
267 * Set a single flag or bit in SREG.
269 * Opcode : 1001 0100 0sss 1000
270 * Usage : BSET
271 * Operation : SREG(s) <- 1
272 * Flags : SREG(s)
273 * Num Clocks : 1
276 public:
277 BSET(word opcode);
279 public:
280 int operator()(Core *core);
281 int trace(Core *core, std::ostream & ostr);
283 protected:
284 unsigned char K;
285 unsigned char S;
288 class BST:public Instruction
291 * Bit Store from Register to T.
293 * Opcode : 1111 101d dddd 0bbb
294 * Usage : BST Rd, b
295 * Operation : T <- Rd(b)
296 * Flags : T
297 * Num Clocks : 1
300 public:
301 BST(word opcode);
303 public:
304 int operator()(Core *core);
305 int trace(Core *core, std::ostream & ostr);
307 protected:
308 unsigned char Rd;
309 unsigned char K;
310 unsigned char S;
314 class CALL : public Instruction {
316 * Call Subroutine.
318 * Opcode : 1001 010k kkkk 111k kkkk kkkk kkkk kkkk
319 * Usage : CALL k
320 * Operation : PC <- k
321 * Flags : None
322 * Num Clocks : 4 / 5
325 public:
326 CALL(word opcode);
328 public:
329 int operator()(Core *core);
330 int trace(Core *core, std::ostream & ostr);
331 bool is2Word() const { return true; }
333 protected:
334 unsigned char KH;
337 class CBI : public Instruction {
339 * Clear Bit in I/O Register.
341 * Opcode : 1001 1000 AAAA Abbb
342 * Usage : CBI A, b
343 * Operation : I/O(A, b) <- 0
344 * Flags : None
345 * Num Clocks : 2
348 public:
349 CBI (word opcode);
350 int operator()(Core *core);
351 int trace(Core *core, std::ostream & ostr);
353 protected:
354 unsigned char ioreg;
355 unsigned char K;
358 class COM : public Instruction {
360 * One's Complement.
362 * Opcode : 1001 010d dddd 0000
363 * Usage : COM Rd
364 * Operation : Rd <- $FF - Rd
365 * Flags : Z,C,N,V,S
366 * Num Clocks : 1
369 public:
370 COM (word opcode);
372 public:
373 int operator()(Core *core);
374 int trace(Core *core, std::ostream & ostr);
376 protected:
377 unsigned char Rd;
378 unsigned char S;
381 class CP : public Instruction {
383 * Compare.
385 * Opcode : 0001 01rd dddd rrrr
386 * Usage : CP Rd, Rr
387 * Operation : Rd - Rr
388 * Flags : Z,C,N,V,S,H
389 * Num Clocks : 1
392 public:
393 CP (word opcode);
395 public:
396 int operator()(Core *core);
397 int trace(Core *core, std::ostream & ostr);
399 protected:
400 unsigned char Rd;
401 unsigned char Rr;
402 unsigned char S;
405 class CPC : public Instruction {
407 * Compare with Carry.
409 * Opcode : 0000 01rd dddd rrrr
410 * Usage : CPC Rd, Rr
411 * Operation : Rd - Rr - C
412 * Flags : Z,C,N,V,S,H
413 * Num Clocks : 1
416 public:
417 CPC (word opcode);
418 int operator()(Core *core);
419 int trace(Core *core, std::ostream & ostr);
421 protected:
422 unsigned char Rd;
423 unsigned char Rr;
424 unsigned char S;
427 class CPI : public Instruction {
429 * Compare with Immediate.
431 * Opcode : 0011 KKKK dddd KKKK
432 * Usage : CPI Rd, K
433 * Operation : Rd - K
434 * Flags : Z,C,N,V,S,H
435 * Num Clocks : 1
438 public:
439 CPI (word opcode);
441 public:
442 int operator()(Core *core);
443 int trace(Core *core, std::ostream & ostr);
446 protected:
447 unsigned char Rd;
448 unsigned char K;
449 unsigned char S;
452 class CPSE : public Instruction {
454 * Compare, Skip if Equal.
456 * Opcode : 0001 00rd dddd rrrr
457 * Usage : CPSE Rd, Rr
458 * Operation : if (Rd = Rr) PC <- PC + 2 or 3
459 * Flags : None
460 * Num Clocks : 1 / 2 / 3
463 public:
464 CPSE (word opcode);
466 public:
467 int operator()(Core *core);
468 int trace(Core *core, std::ostream & ostr);
470 protected:
471 unsigned char Rd;
472 unsigned char Rr;
473 unsigned char S;
476 class DEC : public Instruction {
478 * Decrement.
480 * Opcode : 1001 010d dddd 1010
481 * Usage : DEC Rd
482 * Operation : Rd <- Rd - 1
483 * Flags : Z,N,V,S
484 * Num Clocks : 1
487 public:
488 DEC (word opcode);
489 int operator()(Core *core);
490 int trace(Core *core, std::ostream & ostr);
492 protected:
493 unsigned char Rd;
494 unsigned char S;
497 class EICALL : public Instruction {
499 * Extended Indirect Call to (Z).
501 * Opcode : 1001 0101 0001 1001
502 * Usage : EICALL
503 * Operation : PC(15:0) <- Z, PC(21:16) <- EIND
504 * Flags : None
505 * Num Clocks : 4
508 public:
509 EICALL(word opcode);
511 public:
512 int operator()(Core *core);
513 int trace(Core *core, std::ostream & ostr);
515 protected:
516 unsigned char Rl;
517 unsigned char Rh;
518 unsigned char eind;
521 class EIJMP : public Instruction {
523 * Extended Indirect Jmp to (Z).
525 * Opcode : 1001 0100 0001 1001
526 * Usage : EIJMP
527 * Operation : PC(15:0) <- Z, PC(21:16) <- EIND
528 * Flags : None
529 * Num Clocks : 2
532 public:
533 EIJMP (word opcode);
535 public:
536 int operator()(Core *core);
537 int trace(Core *core, std::ostream & ostr);
539 protected:
540 unsigned char Rl;
541 unsigned char Rh;
542 unsigned char eind;
545 class ELPM_Z : public Instruction {
547 * Extended Load Program Memory.
549 * Opcode : 1001 000d dddd 0110
550 * Usage : ELPM Rd, Z
551 * Operation : R <- (RAMPZ:Z)
552 * Flags : None
553 * Num Clocks : 3
556 public:
557 ELPM_Z (word opcode);
559 public:
560 int operator()(Core *core);
561 int trace(Core *core, std::ostream & ostr);
563 protected:
564 unsigned char Rl;
565 unsigned char Rh;
566 unsigned char Rd;
569 class ELPM_Z_incr:public Instruction {
571 * Extended Ld Prg Mem and Post-Incr.
573 * Opcode : 1001 000d dddd 0111
574 * Usage : ELPM Rd, Z+
575 * Operation : Rd <- (RAMPZ:Z), Z <- Z + 1
576 * Flags : None
577 * Num Clocks : 3
580 public:
581 ELPM_Z_incr(word opcode);
583 public:
584 int operator()(Core *core);
585 int trace(Core *core, std::ostream & ostr);
587 protected:
588 unsigned char Rl;
589 unsigned char Rh;
590 unsigned char Rd;
593 class ELPM : public Instruction {
595 * Extended Load Program Memory.
598 * Opcode : 1001 0101 1101 1000
599 * Usage : ELPM
600 * Operation : R0 <- (RAMPZ:Z)
601 * Flags : None
602 * Num Clocks : 3
605 public:
606 ELPM(word opcode);
608 public:
609 int operator()(Core *core);
610 int trace(Core *core, std::ostream & ostr);
612 protected:
613 unsigned char Rl;
614 unsigned char Rh;
615 unsigned char R0;
618 class EOR:public Instruction {
620 * Exclusive OR.
622 * Opcode : 0010 01rd dddd rrrr
623 * Usage : EOR Rd, Rr
624 * Operation : Rd <- Rd ^ Rr
625 * Flags : Z,N,V,S
626 * Num Clocks : 1
629 public:
630 EOR(word opcode);
632 public:
633 int operator()(Core *core);
634 int trace(Core *core, std::ostream & ostr);
636 protected:
637 unsigned char Rd;
638 unsigned char Rr;
639 unsigned char S;
642 class ESPM : public Instruction {
644 * Extended Store Program Memory.
646 * Opcode : 1001 0101 1111 1000
647 * Usage : ESPM
648 * Operation : Z <- R1:R0
649 * Flags : None
650 * Num Clocks : -
653 public:
654 ESPM(word opcode);
656 public:
657 int operator()(Core *core);
658 int trace(Core *core, std::ostream & ostr);
660 protected:
661 unsigned char R0;
662 unsigned char R1;
665 class FMUL:public Instruction {
667 * Fractional Mult Unsigned.
669 * Opcode : 0000 0011 0ddd 1rrr
670 * Usage : FMUL Rd, Rr
671 * Operation : R1:R0 <- (Rd * Rr)<<1 (UU)
672 * Flags : Z,C
673 * Num Clocks : 2
676 public:
677 FMUL(word opcode);
679 public:
680 int operator()(Core *core);
681 int trace(Core *core, std::ostream & ostr);
683 protected:
684 unsigned char R0;
685 unsigned char R1;
686 unsigned char Rd;
687 unsigned char Rr;
688 unsigned char S;
691 class FMULS : public Instruction {
693 * Fractional Mult Signed.
695 * Opcode : 0000 0011 1ddd 0rrr
696 * Usage : FMULS Rd, Rr
697 * Operation : R1:R0 <- (Rd * Rr)<<1 (SS)
698 * Flags : Z,C
699 * Num Clocks : 2
702 public:
703 FMULS(word opcode);
705 public:
706 int operator()(Core *core);
707 int trace(Core *core, std::ostream & ostr);
709 protected:
710 unsigned char R0;
711 unsigned char R1;
712 unsigned char Rd;
713 unsigned char Rr;
714 unsigned char S;
717 class FMULSU : public Instruction {
719 * Fract Mult Signed w/ Unsigned.
721 * Opcode : 0000 0011 1ddd 1rrr
722 * Usage : FMULSU Rd, Rr
723 * Operation : R1:R0 <- (Rd * Rr)<<1 (SU)
724 * Flags : Z,C
725 * Num Clocks : 2
728 public:
729 FMULSU (word opcode);
731 public:
732 int operator()(Core *core);
733 int trace(Core *core, std::ostream & ostr);
735 protected:
736 unsigned char R0;
737 unsigned char R1;
738 unsigned char Rd;
739 unsigned char Rr;
740 unsigned char S;
743 class ICALL : public Instruction {
745 * Indirect Call to (Z).
747 * Opcode : 1001 0101 0000 1001
748 * Usage : ICALL
749 * Operation : PC(15:0) <- Z, PC(21:16) <- 0
750 * Flags : None
751 * Num Clocks : 3 / 4
754 public:
755 ICALL(word opcode);
757 public:
758 int operator()(Core *core);
759 int trace(Core *core, std::ostream & ostr);
761 protected:
762 unsigned char Rl;
763 unsigned char Rh;
766 class IJMP : public Instruction {
768 * Indirect Jump to (Z).
770 * Opcode : 1001 0100 0000 1001
771 * Usage : IJMP
772 * Operation : PC(15:0) <- Z, PC(21:16) <- 0
773 * Flags : None
774 * Num Clocks : 2
777 public:
778 IJMP(word opcode);
780 public:
781 int operator()(Core *core);
782 int trace(Core *core, std::ostream & ostr);
784 protected:
785 unsigned char Rl;
786 unsigned char Rh;
789 class IN : public Instruction {
791 * In From I/O Location.
793 * Opcode : 1011 0AAd dddd AAAA
794 * Usage : IN Rd, A
795 * Operation : Rd <- I/O(A)
796 * Flags : None
797 * Num Clocks : 1
800 public:
801 IN (word opcode);
803 public:
804 int operator()(Core *core);
805 int trace(Core *core, std::ostream & ostr);
807 protected:
808 unsigned char Rd;
809 unsigned char ioreg;
812 class INC : public Instruction {
814 * Increment.
816 * Opcode : 1001 010d dddd 0011
817 * Usage : INC Rd
818 * Operation : Rd <- Rd + 1
819 * Flags : Z,N,V,S
820 * Num Clocks : 1
823 public:
824 INC (word opcode);
826 public:
827 int operator()(Core *core);
828 int trace(Core *core, std::ostream & ostr);
830 protected:
831 unsigned char Rd;
832 unsigned char S;
835 class JMP : public Instruction {
837 * Jump.
839 * Opcode : 1001 010k kkkk 110k kkkk kkkk kkkk kkkk
840 * Usage : JMP k
841 * Operation : PC <- k
842 * Flags : None
843 * Num Clocks : 3
846 public:
847 JMP(word opcode);
849 public:
850 int operator()(Core *core);
851 int trace(Core *core, std::ostream & ostr);
852 bool is2Word() const { return true; }
854 protected:
855 unsigned int K;
858 class LDD_Y : public Instruction {
860 * Load Indirect with Displacement using index Y.
862 * Opcode : 10q0 qq0d dddd 1qqq
863 * Usage : LDD Rd, Y+q
864 * Operation : Rd <- (Y + q)
865 * Flags : None
866 * Num Clocks : 2
869 public:
870 LDD_Y(word opcode);
872 public:
873 int operator()(Core *core);
874 int trace(Core *core, std::ostream & ostr);
876 protected:
877 unsigned char Rl;
878 unsigned char Rh;
879 unsigned char Rd;
880 unsigned char K;
883 class LDD_Z : public Instruction {
885 * Load Indirect with Displacement using index Z.
887 * Opcode : 10q0 qq0d dddd 0qqq
888 * Usage : LDD Rd, Z+q
889 * Operation : Rd <- (Z + q)
890 * Flags : None
891 * Num Clocks : 2
894 public:
895 LDD_Z(word opcode);
897 public:
898 int operator()(Core *core);
899 int trace(Core *core, std::ostream & ostr);
901 protected:
902 unsigned char Rl;
903 unsigned char Rh;
904 unsigned char Rd;
905 unsigned char K;
908 class LDI : public Instruction {
910 * Load Immediate.
912 * Opcode : 1110 KKKK dddd KKKK
913 * Usage : LDI Rd, K
914 * Operation : Rd <- K
915 * Flags : None
916 * Num Clocks : 1
919 public:
920 LDI(word opcode);
922 public:
923 int operator()(Core *core);
924 int trace(Core *core, std::ostream & ostr);
926 protected:
927 unsigned char Rd;
928 unsigned char K;
931 class LDS : public Instruction {
933 * Load Direct from data space.
935 * Opcode : 1001 000d dddd 0000 kkkk kkkk kkkk kkkk
936 * Usage : LDS Rd, k
937 * Operation : Rd <- (k)
938 * Flags : None
939 * Num Clocks : 2
942 public:
943 LDS(word opcode);
945 public:
946 int operator()(Core *core);
947 int trace(Core *core, std::ostream & ostr);
948 bool is2Word() const { return true; }
950 protected:
951 unsigned char Rd;
954 class LD_X : public Instruction {
956 * Load Indirect using index X.
958 * Opcode : 1001 000d dddd 1100
959 * Usage : LD Rd, X
960 * Operation : Rd <- (X)
961 * Flags : None
962 * Num Clocks : 2
965 public:
966 LD_X(word opcode);
968 public:
969 int operator()(Core *core);
970 int trace(Core *core, std::ostream & ostr);
972 protected:
973 unsigned char Rl;
974 unsigned char Rh;
975 unsigned char Rd;
978 class LD_X_decr : public LD_X {
980 * Load Indirect and Pre-Decrement using index X.
982 * Opcode : 1001 000d dddd 1110
983 * Usage : LD Rd, -X
984 * Operation : X <- X - 1, Rd <- (X)
985 * Flags : None
986 * Num Clocks : 2
989 public:
990 LD_X_decr(word opcode);
992 public:
993 int operator()(Core *core);
994 int trace(Core *core, std::ostream & ostr);
997 class LD_X_incr : public LD_X {
999 * Load Indirect and Post-Increment using index X.
1001 * Opcode : 1001 000d dddd 1101
1002 * Usage : LD Rd, X+
1003 * Operation : Rd <- (X), X <- X + 1
1004 * Flags : None
1005 * Num Clocks : 2
1008 public:
1009 LD_X_incr(word opcode);
1011 public:
1012 int operator()(Core *core);
1013 int trace(Core *core, std::ostream & ostr);
1016 class LD_Y_decr : public Instruction {
1018 * Load Indirect and PreDecrement using index Y.
1020 * Opcode : 1001 000d dddd 1010
1021 * Usage : LD Rd, -Y
1022 * Operation : Y <- Y - 1, Rd <- (Y)
1023 * Flags : None
1024 * Num Clocks : 2
1027 public:
1028 LD_Y_decr(word opcode);
1030 public:
1031 int operator()(Core *core);
1032 int trace(Core *core, std::ostream & ostr);
1034 protected:
1035 unsigned char Rl;
1036 unsigned char Rh;
1037 unsigned char Rd;
1040 class LD_Y_incr : public Instruction {
1042 * Load Indirect and Post-Increment using index Y.
1044 * Opcode : 1001 000d dddd 1001
1045 * Usage : LD Rd, Y+
1046 * Operation : Rd <- (Y), Y <- Y + 1
1047 * Flags : None
1048 * Num Clocks : 2
1051 public:
1052 LD_Y_incr(word opcode);
1054 public:
1055 int operator()(Core *core);
1056 int trace(Core *core, std::ostream & ostr);
1058 protected:
1059 unsigned char Rl;
1060 unsigned char Rh;
1061 unsigned char Rd;
1064 class LD_Z_incr : public Instruction {
1066 * Load Indirect and Post-Increment using index Z.
1068 * Opcode : 1001 000d dddd 0001
1069 * Usage : LD Rd, Z+
1070 * Operation : Rd <- (Z), Z <- Z+1
1071 * Flags : None
1072 * Num Clocks : 2
1075 public:
1076 LD_Z_incr(word opcode);
1078 public:
1079 int operator()(Core *core);
1080 int trace(Core *core, std::ostream & ostr);
1082 protected:
1083 unsigned char Rl;
1084 unsigned char Rh;
1085 unsigned char Rd;
1088 class LD_Z_decr : public Instruction {
1090 * Load Indirect and Pre-Decrement using index Z.
1092 * Opcode : 1001 000d dddd 0010
1093 * Usage : LD Rd, -Z
1094 * Operation : Z <- Z - 1, Rd <- (Z)
1095 * Flags : None
1096 * Num Clocks : 2
1099 public:
1100 LD_Z_decr(word opcode);
1102 public:
1103 int operator()(Core *core);
1104 int trace(Core *core, std::ostream & ostr);
1106 protected:
1107 unsigned char Rl;
1108 unsigned char Rh;
1109 unsigned char Rd;
1112 class LPM_Z : public Instruction {
1114 * Load Program Memory.
1116 * Opcode : 1001 000d dddd 0100
1117 * Usage : LPM Rd, Z
1118 * Operation : Rd <- (Z)
1119 * Flags : None
1120 * Num Clocks : 3
1123 public:
1124 LPM_Z(word opcode);
1126 public:
1127 int operator()(Core *core);
1128 int trace(Core *core, std::ostream & ostr);
1130 protected:
1131 unsigned char Rl;
1132 unsigned char Rh;
1133 unsigned char Rd;
1136 class LPM : public Instruction {
1137 /* Load Program Memory.
1139 * This the same as LPM_Z:public Instruction
1141 * Opcode : 1001 0101 1100 1000
1142 * Usage : LPM
1143 * Operation : R0 <- (Z)
1144 * Flags : None
1145 * Num Clocks : 3
1148 public:
1149 LPM(word opcode);
1151 public:
1152 int operator()(Core *core);
1153 int trace(Core *core, std::ostream & ostr);
1155 protected:
1156 unsigned char Rl;
1157 unsigned char Rh;
1158 unsigned char Rd;
1161 class LPM_Z_incr : public Instruction {
1163 * Load Program Memory and Post-Incr.
1165 * Opcode : 1001 000d dddd 0101
1166 * Usage : LPM Rd, Z+
1167 * Operation : Rd <- (Z), Z <- Z + 1
1168 * Flags : None
1169 * Num Clocks : 3
1172 public:
1173 LPM_Z_incr(word opcode);
1175 public:
1176 int operator()(Core *core);
1177 int trace(Core *core, std::ostream & ostr);
1179 protected:
1180 unsigned char Rl;
1181 unsigned char Rh;
1182 unsigned char Rd;
1185 class LSR : public Instruction {
1187 * Logical Shift Right.
1189 * Opcode : 1001 010d dddd 0110
1190 * Usage : LSR Rd
1191 * Operation : Rd(n) <- Rd(n+1), Rd(7) <- 0, C <- Rd(0)
1192 * Flags : Z,C,N,V,S
1193 * Num Clocks : 1
1196 public:
1197 LSR(word opcode);
1199 public:
1200 int operator()(Core *core);
1201 int trace(Core *core, std::ostream & ostr);
1203 protected:
1204 unsigned char Rd;
1205 unsigned char S;
1208 class MOV:public Instruction {
1209 /* Copy Register.
1211 * Opcode : 0010 11rd dddd rrrr
1212 * Usage : MOV Rd, Rr
1213 * Operation : Rd <- Rr
1214 * Flags : None
1215 * Num Clocks : 1
1218 public:
1219 MOV(word opcode);
1221 public:
1222 int operator()(Core *core);
1223 int trace(Core *core, std::ostream & ostr);
1225 protected:
1226 unsigned char Rd;
1227 unsigned char Rr;
1230 class MOVW:public Instruction {
1232 *Copy Register Pair.
1234 * Opcode : 0000 0001 dddd rrrr
1235 * Usage : MOVW Rd, Rr
1236 * Operation : Rd+1:Rd <- Rr+1:Rr
1237 * Flags : None
1238 * Num Clocks : 1
1241 public:
1242 MOVW(word opcode);
1244 public:
1245 int operator()(Core *core);
1246 int trace(Core *core, std::ostream & ostr);
1248 protected:
1249 unsigned char Rdl;
1250 unsigned char Rdh;
1251 unsigned char Rrl;
1252 unsigned char Rrh;
1255 class MUL : public Instruction {
1257 * Mult Unsigned.
1259 * Opcode : 1001 11rd dddd rrrr
1260 * Usage : MUL Rd, Rr
1261 * Operation : R1:R0 <- Rd * Rr (UU)
1262 * Flags : Z,C
1263 * Num Clocks : 2
1266 public:
1267 MUL(word opcode);
1269 public:
1270 int operator()(Core *core);
1271 int trace(Core *core, std::ostream & ostr);
1273 protected:
1274 unsigned char R0;
1275 unsigned char R1;
1276 unsigned char Rd;
1277 unsigned char Rr;
1278 unsigned char S;
1281 class MULS : public Instruction {
1283 * Mult Signed.
1285 * Opcode : 0000 0010 dddd rrrr
1286 * Usage : MULS Rd, Rr
1287 * Operation : R1:R0 <- Rd * Rr (SS)
1288 * Flags : Z,C
1289 * Num Clocks : 2
1292 public:
1293 MULS(word opcode);
1295 public:
1296 int operator()(Core *core);
1297 int trace(Core *core, std::ostream & ostr);
1299 protected:
1300 unsigned char R0;
1301 unsigned char R1;
1302 unsigned char Rd;
1303 unsigned char Rr;
1304 unsigned char S;
1307 class MULSU:public Instruction {
1309 * Mult Signed with Unsigned.
1311 * Rd(unsigned),Rr(signed), result (signed)
1313 * Opcode : 0000 0011 0ddd 0rrr
1314 * Usage : MULSU Rd, Rr
1315 * Operation : R1:R0 <- Rd * Rr (SU)
1316 * Flags : Z,C
1317 * Num Clocks : 2
1320 public:
1321 MULSU(word opcode);
1323 public:
1324 int operator()(Core *core);
1325 int trace(Core *core, std::ostream & ostr);
1327 protected:
1328 unsigned char R0;
1329 unsigned char R1;
1330 unsigned char Rd;
1331 unsigned char Rr;
1332 unsigned char S;
1335 class NEG : public Instruction {
1337 * Two's Complement.
1339 * Opcode : 1001 010d dddd 0001
1340 * Usage : NEG Rd
1341 * Operation : Rd <- $00 - Rd
1342 * Flags : Z,C,N,V,S,H
1343 * Num Clocks : 1
1346 public:
1347 NEG (word opcode);
1349 public:
1350 int operator()(Core *core);
1351 int trace(Core *core, std::ostream & ostr);
1353 protected:
1354 unsigned char Rd;
1355 unsigned char S;
1358 class NOP : public Instruction {
1360 * No Operation.
1362 * Opcode : 0000 0000 0000 0000
1363 * Usage : NOP
1364 * Operation : None
1365 * Flags : None
1366 * Num Clocks : 1
1369 public:
1370 NOP(word opcode);
1372 public:
1373 int operator()(Core *core);
1374 int trace(Core *core, std::ostream & ostr);
1377 class OR:public Instruction {
1379 * Logical OR.
1381 * Opcode : 0010 10rd dddd rrrr
1382 * Usage : OR Rd, Rr
1383 * Operation : Rd <- Rd or Rr
1384 * Flags : Z,N,V,S
1385 * Num Clocks : 1
1388 public:
1389 OR(word opcode);
1391 public:
1392 int operator()(Core *core);
1393 int trace(Core *core, std::ostream & ostr);
1395 protected:
1396 unsigned char Rd;
1397 unsigned char Rr;
1398 unsigned char S;
1401 class ORI : public Instruction {
1403 * Logical OR with Immed.
1405 * Opcode : 0110 KKKK dddd KKKK
1406 * Usage : ORI Rd, K
1407 * Operation : Rd <- Rd or K
1408 * Flags : Z,N,V,S
1409 * Num Clocks : 1
1412 public:
1413 ORI (word opcode);
1415 public:
1416 int operator()(Core *core);
1417 int trace(Core *core, std::ostream & ostr);
1419 protected:
1420 unsigned char Rd;
1421 unsigned char K;
1422 unsigned char S;
1425 class OUT : public Instruction {
1427 * Out To I/O Location.
1429 * Opcode : 1011 1AAd dddd AAAA
1430 * Usage : OUT A Rd
1431 * Operation : I/O(A) <- Rd
1432 * Flags : None
1433 * Num Clocks : 1
1436 public:
1437 OUT(word opcode);
1439 public:
1440 int operator()(Core *core);
1441 int trace(Core *core, std::ostream & ostr);
1443 protected:
1444 unsigned char Rd;
1445 unsigned char ioreg;
1448 class POP : public Instruction {
1450 * Pop Register from Stack.
1452 * Opcode : 1001 000d dddd 1111
1453 * Usage : POP Rd
1454 * Operation : Rd <- STACK
1455 * Flags : None
1456 * Num Clocks : 2
1459 public:
1460 POP(word opcode);
1462 public:
1463 int operator()(Core *core);
1464 int trace(Core *core, std::ostream & ostr);
1466 protected:
1467 unsigned char Rd;
1470 class PUSH : public Instruction {
1472 * Push Register on Stack.
1474 * Opcode : 1001 001d dddd 1111
1475 * Usage : PUSH Rd
1476 * Operation : STACK <- Rd
1477 * Flags : None
1478 * Num Clocks : 2
1481 public:
1482 PUSH(word opcode);
1484 public:
1485 int operator()(Core *core);
1486 int trace(Core *core, std::ostream & ostr);
1488 protected:
1489 unsigned char Rd;
1492 class RCALL : public Instruction {
1494 * Relative Call Subroutine.
1496 * Opcode : 1101 kkkk kkkk kkkk
1497 * Usage : RCALL k
1498 * Operation : PC <- PC + k + 1
1499 * Flags : None
1500 * Num Clocks : 3 / 4
1503 public:
1504 RCALL(word opcode);
1506 public:
1507 int operator()(Core *core);
1508 int trace(Core *core, std::ostream & ostr);
1510 protected:
1511 signed int K;
1514 class RET : public Instruction {
1516 * Subroutine Return.
1518 * Opcode : 1001 0101 0000 1000
1519 * Usage : RET
1520 * Operation : PC <- STACK
1521 * Flags : None
1522 * Num Clocks : 4 / 5
1525 public:
1526 RET(word opcode);
1528 public:
1529 int operator()(Core *core);
1530 int trace(Core *core, std::ostream & ostr);
1533 class RETI : public Instruction {
1535 * Interrupt Return.
1537 * Opcode : 1001 0101 0001 1000
1538 * Usage : RETI
1539 * Operation : PC <- STACK
1540 * Flags : I
1541 * Num Clocks : 4 / 5
1544 public:
1545 RETI(word opcode);
1547 public:
1548 int operator()(Core *core);
1549 int trace(Core *core, std::ostream & ostr);
1551 protected:
1552 unsigned char S;
1555 class RJMP : public Instruction {
1557 * Relative Jump.
1559 * Opcode : 1100 kkkk kkkk kkkk
1560 * Usage : RJMP k
1561 * Operation : PC <- PC + k + 1
1562 * Flags : None
1563 * Num Clocks : 2
1566 public:
1567 RJMP(word opcode);
1569 public:
1570 int operator()(Core *core);
1571 int trace(Core *core, std::ostream & ostr);
1573 protected:
1574 signed int K;
1577 class ROR : public Instruction {
1579 * Rotate Right Though Carry.
1581 * Opcode : 1001 010d dddd 0111
1582 * Usage : ROR Rd
1583 * Operation : Rd(7) <- C, Rd(n) <- Rd(n+1), C <- Rd(0)
1584 * Flags : Z,C,N,V,S
1585 * Num Clocks : 1
1588 public:
1589 ROR(word opcode);
1591 public:
1592 int operator()(Core *core);
1593 int trace(Core *core, std::ostream & ostr);
1595 protected:
1596 unsigned char Rd;
1597 unsigned char S;
1600 class SBC : public Instruction {
1602 * Subtract with Carry.
1604 * Opcode : 0000 10rd dddd rrrr
1605 * Usage : SBC Rd, Rr
1606 * Operation : Rd <- Rd - Rr - C
1607 * Flags : Z,C,N,V,S,H
1608 * Num Clocks : 1
1611 public:
1612 SBC(word opcode);
1614 public:
1615 int operator()(Core *core);
1616 int trace(Core *core, std::ostream & ostr);
1618 protected:
1619 unsigned char Rd;
1620 unsigned char Rr;
1621 unsigned char S;
1624 class SBCI : public Instruction {
1626 * Subtract Immediate with Carry.
1628 * Opcode : 0100 KKKK dddd KKKK
1629 * Usage : SBCI Rd, K
1630 * Operation : Rd <- Rd - K - C
1631 * Flags : Z,C,N,V,S,H
1632 * Num Clocks : 1
1635 public:
1636 SBCI(word opcode);
1638 public:
1639 int operator()(Core *core);
1640 int trace(Core *core, std::ostream & ostr);
1642 protected:
1643 unsigned char Rd;
1644 unsigned char K;
1645 unsigned char S;
1648 class SBI : public Instruction {
1650 * Set Bit in I/O Register.
1652 * Opcode : 1001 1010 AAAA Abbb
1653 * Usage : SBI A, b
1654 * Operation : I/O(A, b) <- 1
1655 * Flags : None
1656 * Num Clocks : 2
1659 public:
1660 SBI(word opcode);
1662 public:
1663 int operator()(Core *core);
1664 int trace(Core *core, std::ostream & ostr);
1666 protected:
1667 unsigned char ioreg;
1668 unsigned char K;
1671 class SBIC : public Instruction {
1673 * Skip if Bit in I/O Reg Cleared.
1675 * Opcode : 1001 1001 AAAA Abbb
1676 * Usage : SBIC A, b
1677 * Operation : if (I/O(A,b) = 0) PC <- PC + 2 or 3
1678 * Flags : None
1679 * Num Clocks : 1 / 2 / 3
1682 public:
1683 SBIC(word opcode);
1685 public:
1686 int operator()(Core *core);
1687 int trace(Core *core, std::ostream & ostr);
1689 protected:
1690 unsigned char ioreg;
1691 unsigned char K;
1694 class SBIS : public Instruction {
1696 * Skip if Bit in I/O Reg Set.
1698 * Opcode : 1001 1011 AAAA Abbb
1699 * Usage : SBIS A, b
1700 * Operation : if (I/O(A,b) = 1) PC <- PC + 2 or 3
1701 * Flags : None
1702 * Num Clocks : 1 / 2 / 3
1705 public:
1706 SBIS(word opcode);
1708 public:
1709 int operator()(Core *core);
1710 int trace(Core *core, std::ostream & ostr);
1712 protected:
1713 unsigned char ioreg;
1714 unsigned char K;
1717 class SBIW : public Instruction {
1719 * Subtract Immed from Word.
1721 * Opcode : 1001 0111 KKdd KKKK
1722 * Usage : SBIW Rd, K
1723 * Operation : Rd+1:Rd <- Rd+1:Rd - K
1724 * Flags : Z,C,N,V,S
1725 * Num Clocks : 2
1728 public:
1729 SBIW (word opcode);
1731 public:
1732 int operator()(Core *core);
1733 int trace(Core *core, std::ostream & ostr);
1735 protected:
1736 unsigned char Rl;
1737 unsigned char Rh;
1738 unsigned char K;
1739 unsigned char S;
1742 class SBRC : public Instruction {
1744 * Skip if Bit in Reg Cleared.
1746 * Opcode : 1111 110d dddd 0bbb
1747 * Usage : SBRC Rd, b
1748 * Operation : if (Rd(b) = 0) PC <- PC + 2 or 3
1749 * Flags : None
1750 * Num Clocks : 1 / 2 / 3
1753 public:
1754 SBRC (word opcode);
1756 public:
1757 int operator()(Core *core);
1758 int trace(Core *core, std::ostream & ostr);
1760 protected:
1761 unsigned char Rd;
1762 unsigned char K;
1765 class SBRS : public Instruction {
1767 * Skip if Bit in Reg Set.
1769 * Opcode : 1111 111d dddd 0bbb
1770 * Usage : SBRS Rd, b
1771 * Operation : if (Rd(b) = 1) PC <- PC + 2 or 3
1772 * Flags : None
1773 * Num Clocks : 1 / 2 / 3
1776 public:
1777 SBRS (word opcode);
1779 public:
1780 int operator()(Core *core);
1781 int trace(Core *core, std::ostream & ostr);
1783 protected:
1784 unsigned char Rd;
1785 unsigned char K;
1788 class SLEEP : public Instruction {
1790 * Sleep.
1792 * This is device specific and should be overridden by sub-class.
1794 * Opcode : 1001 0101 1000 1000
1795 * Usage : SLEEP
1796 * Operation : (see specific hardware specification for Sleep)
1797 * Flags : None
1798 * Num Clocks : 1
1802 public:
1803 SLEEP(word opcode);
1805 public:
1806 int operator()(Core *core);
1807 int trace(Core *core, std::ostream & ostr);
1810 class SPM : public Instruction {
1812 * Store Program Memory.
1814 * Opcode : 1001 0101 1110 1000
1815 * Usage : SPM
1816 * Operation : (Z) <- R1:R0
1817 * Flags : None
1818 * Num Clocks : -
1821 public:
1822 SPM(word opcode);
1824 public:
1825 int operator()(Core *core);
1826 int trace(Core *core, std::ostream & ostr);
1828 protected:
1829 unsigned char R0;
1830 unsigned char R1;
1831 unsigned char Rl;
1832 unsigned char Rh;
1835 class STD_Y : public Instruction {
1837 * Store Indirect with Displacement.
1839 * Opcode : 10q0 qq1d dddd 1qqq
1840 * Usage : STD Y+q, Rd
1841 * Operation : (Y + q) <- Rd
1842 * Flags : None
1843 * Num Clocks : 2
1846 public:
1847 STD_Y(word opcode);
1849 public:
1850 int operator()(Core *core);
1851 int trace(Core *core, std::ostream & ostr);
1853 protected:
1854 unsigned char Rl;
1855 unsigned char Rh;
1856 unsigned char Rd;
1857 unsigned char K;
1860 class STD_Z : public Instruction {
1862 * Store Indirect with Displacement.
1864 * Opcode : 10q0 qq1d dddd 0qqq
1865 * Usage : STD Z+q, Rd
1866 * Operation : (Z + q) <- Rd
1867 * Flags : None
1868 * Num Clocks : 2
1871 public:
1872 STD_Z(word opcode);
1874 public:
1875 int operator()(Core *core);
1876 int trace(Core *core, std::ostream & ostr);
1878 protected:
1879 unsigned char Rl;
1880 unsigned char Rh;
1881 unsigned char Rd;
1882 unsigned char K;
1885 class STS : public Instruction {
1887 * Store Direct to data space.
1889 * Opcode : 1001 001d dddd 0000 kkkk kkkk kkkk kkkk
1890 * Usage : STS k, Rd
1891 * Operation : (k) <- Rd
1892 * Flags : None
1893 * Num Clocks : 2
1896 public:
1897 STS(word opcode);
1899 public:
1900 int operator()(Core *core);
1901 int trace(Core *core, std::ostream & ostr);
1902 bool is2Word() const { return true; }
1904 protected:
1905 unsigned char Rd;
1908 class ST_X : public Instruction {
1910 * Store Indirect using index X.
1912 * Opcode : 1001 001d dddd 1100
1913 * Usage : ST X, Rd
1914 * Operation : (X) <- Rd
1915 * Flags : None
1916 * Num Clocks : 2
1919 public:
1920 ST_X(word opcode);
1922 public:
1923 int operator()(Core *core);
1924 int trace(Core *core, std::ostream & ostr);
1926 protected:
1927 unsigned char Rl;
1928 unsigned char Rh;
1929 unsigned char Rd;
1932 class ST_X_decr : public ST_X {
1934 * Store Indirect and Pre-Decrement using index X.
1936 * Opcode : 1001 001d dddd 1110
1937 * Usage : ST -X, Rd
1938 * Operation : X <- X - 1, (X) <- Rd
1939 * Flags : None
1940 * Num Clocks : 2
1943 public:
1944 ST_X_decr(word opcode);
1946 public:
1947 int operator()(Core *core);
1948 int trace(Core *core, std::ostream & ostr);
1951 class ST_X_incr : public ST_X {
1953 * Store Indirect and Post-Increment using index X.
1955 * Opcode : 1001 001d dddd 1101
1956 * Usage : ST X+, Rd
1957 * Operation : (X) <- Rd, X <- X + 1
1958 * Flags : None
1959 * Num Clocks : 2
1962 public:
1963 ST_X_incr(word opcode);
1965 public:
1966 int operator()(Core *core);
1967 int trace(Core *core, std::ostream & ostr);
1970 class ST_Y_decr : public Instruction {
1972 * Store Indirect and Pre-Decrement using index Y.
1974 * Opcode : 1001 001d dddd 1010
1975 * Usage : ST -Y, Rd
1976 * Operation : Y <- Y - 1, (Y) <- Rd
1977 * Flags : None
1978 * Num Clocks : 2
1981 public:
1982 ST_Y_decr (word opcode);
1984 public:
1985 int operator()(Core *core);
1986 int trace(Core *core, std::ostream & ostr);
1988 protected:
1989 unsigned char Rl;
1990 unsigned char Rh;
1991 unsigned char Rd;
1994 class ST_Y_incr : public Instruction {
1996 * Store Indirect and Post-Increment using index Y.
1998 * Opcode : 1001 001d dddd 1001
1999 * Usage : ST Y+, Rd
2000 * Operation : (Y) <- Rd, Y <- Y + 1
2001 * Flags : None
2002 * Num Clocks : 2
2005 public:
2006 ST_Y_incr (word opcode);
2008 public:
2009 int operator()(Core *core);
2010 int trace(Core *core, std::ostream & ostr);
2012 protected:
2013 unsigned char Rl;
2014 unsigned char Rh;
2015 unsigned char Rd;
2018 class ST_Z_decr : public Instruction {
2020 * Store Indirect and Pre-Decrement using index Z.
2022 * Opcode : 1001 001d dddd 0010
2023 * Usage : ST -Z, Rd
2024 * Operation : Z <- Z - 1, (Z) <- Rd
2025 * Flags : None
2026 * Num Clocks : 2
2029 public:
2030 ST_Z_decr (word opcode);
2032 public:
2033 int operator()(Core *core);
2034 int trace(Core *core, std::ostream & ostr);
2036 protected:
2037 unsigned char Rl;
2038 unsigned char Rh;
2039 unsigned char Rd;
2042 class ST_Z_incr : public Instruction {
2044 * Store Indirect and Post-Increment using index Z.
2046 * Opcode : 1001 001d dddd 0001
2047 * Usage : ST Z+, Rd
2048 * Operation : (Z) <- Rd, Z <- Z + 1
2049 * Flags : None
2050 * Num Clocks : 2
2053 public:
2054 ST_Z_incr (word opcode);
2056 public:
2057 int operator()(Core *core);
2058 int trace(Core *core, std::ostream & ostr);
2060 protected:
2061 unsigned char Rl;
2062 unsigned char Rh;
2063 unsigned char Rd;
2066 class SUB : public Instruction {
2068 * Subtract without Carry.
2070 * Opcode : 0001 10rd dddd rrrr
2071 * Usage : SUB Rd, Rr
2072 * Operation : Rd <- Rd - Rr
2073 * Flags : Z,C,N,V,S,H
2074 * Num Clocks : 1
2077 public:
2078 SUB(word opcode);
2080 public:
2081 int operator()(Core *core);
2082 int trace(Core *core, std::ostream & ostr);
2084 protected:
2085 unsigned char Rd;
2086 unsigned char Rr;
2089 class SUBI : public Instruction {
2091 * Subtract Immediate.
2093 * Opcode : 0101 KKKK dddd KKKK
2094 * Usage : SUBI Rd, K
2095 * Operation : Rd <- Rd - K
2096 * Flags : Z,C,N,V,S,H
2097 * Num Clocks : 1
2100 public:
2101 SUBI(word opcode);
2103 public:
2104 int operator()(Core *core);
2105 int trace(Core *core, std::ostream & ostr);
2107 protected:
2108 unsigned char Rd;
2109 unsigned char K;
2110 unsigned char S;
2113 class SWAP : public Instruction {
2115 * Swap Nibbles.
2117 * Opcode : 1001 010d dddd 0010
2118 * Usage : SWAP Rd
2119 * Operation : Rd(3..0) <--> Rd(7..4)
2120 * Flags : None
2121 * Num Clocks : 1
2124 public:
2125 SWAP(word opcode);
2127 public:
2128 int operator()(Core *core);
2129 int trace(Core *core, std::ostream & ostr);
2131 protected:
2132 unsigned char Rd;
2135 class WDR : public Instruction {
2137 * Watchdog Reset.
2139 * This is device specific and must be overridden by sub-class.
2141 * Opcode : 1001 0101 1010 1000
2142 * Usage : WDR
2143 * Operation : (see specific hardware specification for WDR)
2144 * Flags : None
2145 * Num Clocks : 1
2148 public:
2149 WDR(word opcode);
2151 public:
2152 int operator()(Core *core);
2153 int trace(Core *core, std::ostream & ostr);
2156 class BREAK : public Instruction {
2158 * On-chip Debug system break.
2160 * Opcode : 1001 0101 1001 1000
2161 * Usage : BREAK
2162 * Operation : (see specific hardware specification for BREAK)
2163 * Flags : None
2164 * Num Clocks : 1
2167 public:
2168 BREAK(word opcode);
2170 public:
2171 int operator()(Core *core);
2172 int trace(Core *core, std::ostream & ostr);
2175 class ILLEGAL : public Instruction {
2176 //illegal instruction
2178 public:
2179 ILLEGAL(word opcode);
2181 public:
2182 int operator()(Core *core);
2183 int trace(Core *core, std::ostream & ostr);
2185 private:
2186 word opcode;
2193 #endif /*AVR_INSTRUCTIONS_H*/