00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef DECODER
00027 #define DECODER
00028
00029 #include <iostream>
00030
00031 #include "rwmem.h"
00032 #include "types.h"
00033 #include "avrdevice.h"
00034
00035 class AvrFlash;
00036
00038
00039 class DecodedInstruction {
00040
00041 protected:
00042 AvrDevice *core;
00043 bool size2Word;
00044
00045 public:
00046 DecodedInstruction(AvrDevice *c, bool s2w = false): core(c), size2Word(s2w) {}
00047 virtual ~DecodedInstruction() {}
00048
00050 bool IsInstruction2Words() { return size2Word; }
00051
00053 virtual int operator()() = 0;
00055 virtual int Trace() = 0;
00057 virtual unsigned char GetModifiedR() const {return -1;}
00059 virtual unsigned char GetModifiedRHi() const {return -1;}
00060 };
00061
00063 DecodedInstruction* lookup_opcode(word opcode, AvrDevice *core);
00064
00065 class avr_op_ADC: public DecodedInstruction {
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 protected:
00076 unsigned char R1;
00077 unsigned char R2;
00078 HWSreg *status;
00079
00080 public:
00081 avr_op_ADC(word opcode, AvrDevice *c);
00082 virtual unsigned char GetModifiedR() const;
00083 int operator()();
00084 int Trace();
00085 };
00086
00087 class avr_op_ADD: public DecodedInstruction {
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097 protected:
00098 unsigned char R1;
00099 unsigned char R2;
00100 HWSreg *status;
00101
00102 public:
00103 avr_op_ADD(word opcode, AvrDevice *c);
00104 virtual unsigned char GetModifiedR() const;
00105 int operator()();
00106 int Trace();
00107 };
00108
00109
00110
00111
00112 class avr_op_ADIW: public DecodedInstruction
00113 {
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124 protected:
00125 unsigned char Rl;
00126 unsigned char Rh;
00127 unsigned char K;
00128 HWSreg *status;
00129
00130 public:
00131 avr_op_ADIW(word opcode, AvrDevice *c);
00132 virtual unsigned char GetModifiedR() const;
00133 virtual unsigned char GetModifiedRHi() const;
00134 int operator()();
00135 int Trace();
00136 };
00137
00138 class avr_op_AND: public DecodedInstruction
00139 {
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 protected:
00151 unsigned char R1;
00152 unsigned char R2;
00153 HWSreg *status;
00154
00155 public:
00156 avr_op_AND(word opcode, AvrDevice *c);
00157 int operator()();
00158 int Trace();
00159 };
00160
00161 class avr_op_ANDI: public DecodedInstruction
00162 {
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173 protected:
00174 unsigned char R1;
00175 unsigned char K;
00176 HWSreg *status;
00177
00178 public:
00179 avr_op_ANDI(word opcode, AvrDevice *c);
00180 int operator()();
00181 int Trace();
00182 };
00183
00184 class avr_op_ASR:public DecodedInstruction
00185 {
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196 protected:
00197 unsigned char R1;
00198 HWSreg *status;
00199
00200 public:
00201 avr_op_ASR(word opcode, AvrDevice *c);
00202 int operator()();
00203 int Trace();
00204 };
00205
00206 class avr_op_BCLR: public DecodedInstruction
00207 {
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218 protected:
00219 HWSreg *status;
00220 unsigned char Kbit;
00221
00222 public:
00223 avr_op_BCLR(word opcode, AvrDevice *c);
00224 int operator()();
00225 int Trace();
00226 };
00227
00228
00229 class avr_op_BLD: public DecodedInstruction
00230 {
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240 protected:
00241 unsigned char R1;
00242 unsigned char Kbit;
00243 HWSreg *status;
00244
00245 public:
00246 avr_op_BLD(word opcode, AvrDevice *c);
00247 int operator()();
00248 int Trace();
00249 };
00250
00251 class avr_op_BRBC: public DecodedInstruction
00252 {
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268 protected:
00269 HWSreg *status;
00270 unsigned char bitmask;
00271 signed char offset;
00272
00273 public:
00274 avr_op_BRBC(word opcode, AvrDevice *c);
00275 int operator()();
00276 int Trace();
00277 };
00278
00279 class avr_op_BRBS: public DecodedInstruction
00280 {
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296 protected:
00297 HWSreg *status;
00298 unsigned char bitmask;
00299 signed char offset;
00300
00301 public:
00302 avr_op_BRBS(word opcode, AvrDevice *c);
00303 int operator()();
00304 int Trace();
00305 };
00306
00307 class avr_op_BSET: public DecodedInstruction
00308 {
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319 protected:
00320 HWSreg *status;
00321 unsigned char Kbit;
00322
00323 public:
00324 avr_op_BSET(word opcode, AvrDevice *c);
00325 int operator()();
00326 int Trace();
00327 };
00328
00329 class avr_op_BST: public DecodedInstruction
00330 {
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341 protected:
00342 unsigned char R1;
00343 unsigned char Kbit;
00344 HWSreg *status;
00345
00346 public:
00347 avr_op_BST(word opcode, AvrDevice *c);
00348 int operator()();
00349 int Trace();
00350
00351 };
00352
00353 class avr_op_CALL: public DecodedInstruction
00354 {
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365 protected:
00366 unsigned char KH;
00367
00368 public:
00369 avr_op_CALL(word opcode, AvrDevice *c);
00370 int operator()();
00371 int Trace();
00372 };
00373
00374 class avr_op_CBI: public DecodedInstruction
00375 {
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386 protected:
00387 unsigned char ioreg;
00388 unsigned char Kbit;
00389 HWSreg *status;
00390
00391 public:
00392 avr_op_CBI(word opcode, AvrDevice *c);
00393 int operator()();
00394 int Trace();
00395 };
00396
00397 class avr_op_COM: public DecodedInstruction
00398 {
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409 protected:
00410 unsigned char R1;
00411 HWSreg *status;
00412
00413 public:
00414 avr_op_COM(word opcode, AvrDevice *c);
00415 int operator()();
00416 int Trace();
00417 };
00418
00419 class avr_op_CP: public DecodedInstruction
00420 {
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431 protected:
00432 unsigned char R1;
00433 unsigned char R2;
00434 HWSreg *status;
00435
00436 public:
00437 avr_op_CP(word opcode, AvrDevice *c);
00438 int operator()();
00439 int Trace();
00440 };
00441
00442 class avr_op_CPC: public DecodedInstruction
00443 {
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454 protected:
00455 unsigned char R1;
00456 unsigned char R2;
00457 HWSreg *status;
00458
00459 public:
00460 avr_op_CPC(word opcode, AvrDevice *c);
00461 int operator()();
00462 int Trace();
00463 };
00464
00465 class avr_op_CPI: public DecodedInstruction
00466 {
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477 protected:
00478 unsigned char R1;
00479 unsigned char K;
00480 HWSreg *status;
00481
00482 public:
00483 avr_op_CPI(word opcode, AvrDevice *c);
00484 int operator()();
00485 int Trace();
00486
00487 };
00488
00489 class avr_op_CPSE: public DecodedInstruction
00490 {
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501 protected:
00502 unsigned char R1;
00503 unsigned char R2;
00504 HWSreg *status;
00505
00506 public:
00507 avr_op_CPSE(word opcode, AvrDevice *c);
00508 int operator()();
00509 int Trace();
00510 };
00511
00512 class avr_op_DEC: public DecodedInstruction
00513 {
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524 protected:
00525 unsigned char R1;
00526 HWSreg *status;
00527
00528 public:
00529 avr_op_DEC(word opcode, AvrDevice *c);
00530 int operator()();
00531 int Trace();
00532 };
00533
00534 class avr_op_EICALL: public DecodedInstruction
00535 {
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546 public:
00547 avr_op_EICALL(word opcode, AvrDevice *c);
00548 int operator()();
00549 int Trace();
00550 };
00551
00552 class avr_op_EIJMP: public DecodedInstruction
00553 {
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564 public:
00565 avr_op_EIJMP(word opcode, AvrDevice *c);
00566 int operator()();
00567 int Trace();
00568 };
00569
00570 class avr_op_ELPM_Z: public DecodedInstruction
00571 {
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582 protected:
00583 unsigned char R1;
00584
00585 public:
00586 avr_op_ELPM_Z(word opcode, AvrDevice *c);
00587 int operator()();
00588 int Trace();
00589 };
00590
00591 class avr_op_ELPM_Z_incr: public DecodedInstruction
00592 {
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603 protected:
00604 unsigned char R1;
00605
00606 public:
00607 avr_op_ELPM_Z_incr(word opcode, AvrDevice *c);
00608 int operator()();
00609 int Trace();
00610 };
00611
00612 class avr_op_ELPM: public DecodedInstruction
00613 {
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625 public:
00626 avr_op_ELPM(word opcode, AvrDevice *c);
00627 int operator()();
00628 int Trace();
00629 };
00630
00631 class avr_op_EOR: public DecodedInstruction
00632 {
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643 protected:
00644 unsigned char R1;
00645 unsigned char R2;
00646 HWSreg *status;
00647
00648 public:
00649 avr_op_EOR(word opcode, AvrDevice *c);
00650 int operator()();
00651 int Trace();
00652 };
00653
00654 class avr_op_ESPM: public DecodedInstruction
00655 {
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667 public:
00668 avr_op_ESPM(word opcode, AvrDevice *c);
00669 int operator()();
00670 int Trace();
00671 };
00672
00673 class avr_op_FMUL:public DecodedInstruction
00674 {
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685 protected:
00686 unsigned char Rd;
00687 unsigned char Rr;
00688 HWSreg *status;
00689
00690 public:
00691 avr_op_FMUL(word opcode, AvrDevice *c);
00692 int operator()();
00693 int Trace();
00694 };
00695
00696 class avr_op_FMULS: public DecodedInstruction
00697 {
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708 protected:
00709 unsigned char Rd;
00710 unsigned char Rr;
00711 HWSreg *status;
00712
00713 public:
00714 avr_op_FMULS(word opcode, AvrDevice *c);
00715 int operator()();
00716 int Trace();
00717 };
00718
00719 class avr_op_FMULSU: public DecodedInstruction
00720 {
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731 protected:
00732 unsigned char Rd;
00733 unsigned char Rr;
00734 HWSreg *status;
00735
00736 public:
00737 avr_op_FMULSU(word opcode, AvrDevice *c);
00738 int operator()();
00739 int Trace();
00740 };
00741
00742 class avr_op_ICALL: public DecodedInstruction
00743 {
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754 public:
00755 avr_op_ICALL(word opcode, AvrDevice *c);
00756 int operator()();
00757 int Trace();
00758 };
00759
00760 class avr_op_IJMP: public DecodedInstruction
00761 {
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772 public:
00773 avr_op_IJMP (word opcode, AvrDevice *c);
00774 int operator()();
00775 int Trace();
00776 };
00777
00778 class avr_op_IN: public DecodedInstruction
00779 {
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790 protected:
00791 unsigned char R1;
00792 unsigned char ioreg;
00793
00794 public:
00795 avr_op_IN(word opcode, AvrDevice *c);
00796 int operator()();
00797 int Trace();
00798 };
00799
00800 class avr_op_INC: public DecodedInstruction
00801 {
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812 protected:
00813 unsigned char R1;
00814 HWSreg *status;
00815
00816 public:
00817 avr_op_INC(word opcode, AvrDevice *c);
00818 int operator()();
00819 int Trace();
00820 };
00821
00822 class avr_op_JMP: public DecodedInstruction
00823 {
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834 protected:
00835 unsigned int K;
00836
00837 public:
00838 avr_op_JMP (word opcode, AvrDevice *c);
00839 int operator()();
00840 int Trace();
00841 };
00842
00843 class avr_op_LDD_Y: public DecodedInstruction
00844 {
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855 protected:
00856 unsigned char Rd;
00857 unsigned char K;
00858
00859 public:
00860 avr_op_LDD_Y(word opcode, AvrDevice *c);
00861 int operator()();
00862 int Trace();
00863 };
00864
00865 class avr_op_LDD_Z: public DecodedInstruction
00866 {
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877 protected:
00878 unsigned char Rd;
00879 unsigned char K;
00880
00881 public:
00882 avr_op_LDD_Z(word opcode, AvrDevice *c);
00883 int operator()();
00884 int Trace();
00885 };
00886
00887 class avr_op_LDI: public DecodedInstruction
00888 {
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899 protected:
00900 unsigned char R1;
00901 unsigned char K;
00902
00903 public:
00904 avr_op_LDI(word opcode, AvrDevice *c);
00905 virtual unsigned char GetModifiedR() const;
00906 int operator()();
00907 int Trace();
00908 };
00909
00910 class avr_op_LDS: public DecodedInstruction
00911 {
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922 protected:
00923 unsigned char R1;
00924
00925 public:
00926 avr_op_LDS(word opcode, AvrDevice *c);
00927 int operator()();
00928 int Trace();
00929 };
00930
00931 class avr_op_LD_X: public DecodedInstruction
00932 {
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943 protected:
00944 unsigned char Rd;
00945
00946 public:
00947 avr_op_LD_X(word opcode, AvrDevice *c);
00948 int operator()();
00949 int Trace();
00950 };
00951
00952 class avr_op_LD_X_decr: public DecodedInstruction
00953 {
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964 protected:
00965 unsigned char Rd;
00966
00967 public:
00968 avr_op_LD_X_decr(word opcode, AvrDevice *c);
00969 int operator()();
00970 int Trace();
00971 };
00972
00973 class avr_op_LD_X_incr: public DecodedInstruction
00974 {
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985 protected:
00986 unsigned char Rd;
00987
00988 public:
00989 avr_op_LD_X_incr(word opcode, AvrDevice *c);
00990 int operator()();
00991 int Trace();
00992 };
00993
00994 class avr_op_LD_Y_decr: public DecodedInstruction
00995 {
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007 protected:
01008 unsigned char Rd;
01009
01010 public:
01011 avr_op_LD_Y_decr(word opcode, AvrDevice *c);
01012 int operator()();
01013 int Trace();
01014 };
01015
01016 class avr_op_LD_Y_incr: public DecodedInstruction
01017 {
01018
01019
01020
01021
01022
01023
01024
01025
01026
01027
01028 protected:
01029 unsigned char Rd;
01030
01031 public:
01032 avr_op_LD_Y_incr(word opcode, AvrDevice *c);
01033 int operator()();
01034 int Trace();
01035 };
01036
01037 class avr_op_LD_Z_incr: public DecodedInstruction
01038 {
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049 protected:
01050 unsigned char Rd;
01051
01052 public:
01053 avr_op_LD_Z_incr(word opcode, AvrDevice *c);
01054 int operator()();
01055 int Trace();
01056 };
01057
01058 class avr_op_LD_Z_decr: public DecodedInstruction
01059 {
01060
01061
01062
01063
01064
01065
01066
01067
01068
01069
01070 protected:
01071 unsigned char Rd;
01072
01073 public:
01074 avr_op_LD_Z_decr(word opcode, AvrDevice *c);
01075 int operator()();
01076 int Trace();
01077 };
01078
01079 class avr_op_LPM_Z: public DecodedInstruction
01080 {
01081
01082
01083
01084
01085
01086
01087
01088
01089
01090
01091 protected:
01092 unsigned char Rd;
01093
01094 public:
01095 avr_op_LPM_Z(word opcode, AvrDevice *c);
01096 int operator()();
01097 int Trace();
01098 };
01099
01100 class avr_op_LPM: public DecodedInstruction
01101 {
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114 public:
01115 avr_op_LPM(word opcode, AvrDevice *c);
01116 int operator()();
01117 int Trace();
01118 };
01119
01120 class avr_op_LPM_Z_incr: public DecodedInstruction
01121 {
01122
01123
01124
01125
01126
01127
01128
01129
01130
01131
01132 protected:
01133 unsigned char Rd;
01134
01135 public:
01136 avr_op_LPM_Z_incr(word opcode, AvrDevice *c);
01137 int operator()();
01138 int Trace();
01139 };
01140
01141 class avr_op_LSR: public DecodedInstruction
01142 {
01143
01144
01145
01146
01147
01148
01149
01150
01151
01152
01153 protected:
01154 unsigned char Rd;
01155 HWSreg *status;
01156
01157 public:
01158 avr_op_LSR(word opcode, AvrDevice *c);
01159 int operator()();
01160 int Trace();
01161 };
01162
01163 class avr_op_MOV: public DecodedInstruction
01164 {
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174 protected:
01175 unsigned char R1;
01176 unsigned char R2;
01177
01178 public:
01179 avr_op_MOV(word opcode, AvrDevice *c);
01180 int operator()();
01181 int Trace();
01182 };
01183
01184 class avr_op_MOVW: public DecodedInstruction
01185 {
01186
01187
01188
01189
01190
01191
01192
01193
01194
01195
01196 protected:
01197 unsigned char Rd;
01198 unsigned char Rs;
01199
01200 public:
01201 avr_op_MOVW(word opcode, AvrDevice *c);
01202 int operator()();
01203 int Trace();
01204 };
01205
01206 class avr_op_MUL: public DecodedInstruction
01207 {
01208
01209
01210
01211
01212
01213
01214
01215
01216
01217
01218 protected:
01219 unsigned char Rd;
01220 unsigned char Rr;
01221 HWSreg *status;
01222
01223 public:
01224 avr_op_MUL(word opcode, AvrDevice *c);
01225 int operator()();
01226 int Trace();
01227 };
01228
01229 class avr_op_MULS: public DecodedInstruction
01230 {
01231
01232
01233
01234
01235
01236
01237
01238
01239
01240
01241 protected:
01242 unsigned char Rd;
01243 unsigned char Rr;
01244 HWSreg *status;
01245
01246 public:
01247 avr_op_MULS(word opcode, AvrDevice *c);
01248 int operator()();
01249 int Trace();
01250 };
01251
01252 class avr_op_MULSU: public DecodedInstruction
01253 {
01254
01255
01256
01257
01258
01259
01260
01261
01262
01263
01264
01265
01266
01267 protected:
01268 unsigned char Rd;
01269 unsigned char Rr;
01270 HWSreg *status;
01271
01272 public:
01273 avr_op_MULSU(word opcode, AvrDevice *c);
01274 int operator()();
01275 int Trace();
01276 };
01277
01278 class avr_op_NEG: public DecodedInstruction
01279 {
01280
01281
01282
01283
01284
01285
01286
01287
01288
01289
01290 protected:
01291 unsigned char Rd;
01292 HWSreg *status;
01293
01294 public:
01295 avr_op_NEG(word opcode, AvrDevice *c);
01296 int operator()();
01297 int Trace();
01298 };
01299
01300 class avr_op_NOP: public DecodedInstruction
01301 {
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312
01313 public:
01314 avr_op_NOP(word opcode, AvrDevice *c);
01315 int operator()();
01316 int Trace();
01317 };
01318
01319 class avr_op_OR:public DecodedInstruction
01320 {
01321
01322
01323
01324
01325
01326
01327
01328
01329
01330
01331 protected:
01332 unsigned char Rd;
01333 unsigned char Rr;
01334 HWSreg *status;
01335
01336 public:
01337 avr_op_OR(word opcode, AvrDevice *c);
01338 int operator()();
01339 int Trace();
01340 };
01341
01342 class avr_op_ORI: public DecodedInstruction
01343 {
01344
01345
01346
01347
01348
01349
01350
01351
01352
01353
01354 protected:
01355 unsigned char R1;
01356 unsigned char K;
01357 HWSreg *status;
01358
01359 public:
01360 avr_op_ORI(word opcode, AvrDevice *c);
01361 int operator()();
01362 int Trace();
01363 };
01364
01365 class avr_op_OUT: public DecodedInstruction
01366 {
01367
01368
01369
01370
01371
01372
01373
01374
01375
01376
01377 protected:
01378 unsigned char ioreg;
01379 unsigned char R1;
01380
01381 public:
01382 avr_op_OUT(word opcode, AvrDevice *c);
01383 int operator()();
01384 int Trace();
01385
01386 friend class AvrFlash;
01387 };
01388
01389 class avr_op_POP: public DecodedInstruction
01390 {
01391
01392
01393
01394
01395
01396
01397
01398
01399
01400
01401 protected:
01402 unsigned char R1;
01403
01404 public:
01405 avr_op_POP(word opcode, AvrDevice *c);
01406 int operator()();
01407 int Trace();
01408 };
01409
01410 class avr_op_PUSH: public DecodedInstruction
01411 {
01412
01413
01414
01415
01416
01417
01418
01419
01420
01421
01422 protected:
01423 unsigned char R1;
01424
01425 public:
01426 avr_op_PUSH(word opcode, AvrDevice *c);
01427 int operator()();
01428 int Trace();
01429 };
01430
01431 class avr_op_RCALL: public DecodedInstruction
01432 {
01433
01434
01435
01436
01437
01438
01439
01440
01441
01442
01443 protected:
01444 signed int K;
01445
01446 public:
01447 avr_op_RCALL(word opcode, AvrDevice *c);
01448 int operator()();
01449 int Trace();
01450 };
01451
01452 class avr_op_RET: public DecodedInstruction
01453 {
01454
01455
01456
01457
01458
01459
01460
01461
01462
01463
01464 public:
01465 avr_op_RET(word opcode, AvrDevice *c);
01466 int operator()();
01467 int Trace();
01468 };
01469
01470 class avr_op_RETI: public DecodedInstruction
01471 {
01472
01473
01474
01475
01476
01477
01478
01479
01480
01481
01482 protected:
01483 HWSreg *status;
01484
01485 public:
01486 avr_op_RETI(word opcode, AvrDevice *c);
01487 int operator()();
01488 int Trace();
01489 };
01490
01491 class avr_op_RJMP: public DecodedInstruction
01492 {
01493
01494
01495
01496
01497
01498
01499
01500
01501
01502
01503 protected:
01504 signed int K;
01505
01506 public:
01507 avr_op_RJMP(word opcode, AvrDevice *c);
01508 int operator()();
01509 int Trace();
01510 };
01511
01512 class avr_op_ROR: public DecodedInstruction
01513 {
01514
01515
01516
01517
01518
01519
01520
01521
01522
01523
01524 protected:
01525 unsigned char R1;
01526 HWSreg *status;
01527
01528 public:
01529 avr_op_ROR(word opcode, AvrDevice *c);
01530 int operator()();
01531 int Trace();
01532 };
01533
01534 class avr_op_SBC: public DecodedInstruction
01535 {
01536
01537
01538
01539
01540
01541
01542
01543
01544
01545
01546 protected:
01547 unsigned char R1;
01548 unsigned char R2;
01549 HWSreg *status;
01550
01551 public:
01552 avr_op_SBC(word opcode, AvrDevice *c);
01553 virtual unsigned char GetModifiedR() const;
01554 int operator()();
01555 int Trace();
01556 };
01557
01558 class avr_op_SBCI: public DecodedInstruction
01559 {
01560
01561
01562
01563
01564
01565
01566
01567
01568
01569
01570 protected:
01571 unsigned char R1;
01572 unsigned char K;
01573 HWSreg *status;
01574
01575 public:
01576 avr_op_SBCI(word opcode, AvrDevice *c);
01577 virtual unsigned char GetModifiedR() const;
01578 int operator()();
01579 int Trace();
01580 };
01581
01582 class avr_op_SBI: public DecodedInstruction
01583 {
01584
01585
01586
01587
01588
01589
01590
01591
01592
01593
01594 protected:
01595 unsigned char ioreg;
01596 unsigned char Kbit;
01597
01598 public:
01599 avr_op_SBI(word opcode, AvrDevice *c);
01600 int operator()();
01601 int Trace();
01602 };
01603
01604 class avr_op_SBIC: public DecodedInstruction
01605 {
01606
01607
01608
01609
01610
01611
01612
01613
01614
01615
01616 protected:
01617 unsigned char ioreg;
01618 unsigned char Kbit;
01619
01620 public:
01621 avr_op_SBIC(word opcode, AvrDevice *c);
01622 int operator()();
01623 int Trace();
01624 };
01625
01626 class avr_op_SBIS: public DecodedInstruction
01627 {
01628
01629
01630
01631
01632
01633
01634
01635
01636
01637
01638 protected:
01639 unsigned char ioreg;
01640 unsigned char Kbit;
01641
01642 public:
01643 avr_op_SBIS(word opcode, AvrDevice *c);
01644 int operator()();
01645 int Trace();
01646 };
01647
01648 class avr_op_SBIW: public DecodedInstruction
01649 {
01650
01651
01652
01653
01654
01655
01656
01657
01658
01659
01660 protected:
01661 unsigned char R1;
01662 unsigned char K;
01663 HWSreg *status;
01664
01665 public:
01666 avr_op_SBIW(word opcode, AvrDevice *c);
01667 virtual unsigned char GetModifiedR() const;
01668 virtual unsigned char GetModifiedRHi() const;
01669 int operator()();
01670 int Trace();
01671 };
01672
01673 class avr_op_SBRC: public DecodedInstruction
01674 {
01675
01676
01677
01678
01679
01680
01681
01682
01683
01684
01685 protected:
01686 unsigned char R1;
01687 unsigned char Kbit;
01688
01689 public:
01690 avr_op_SBRC(word opcode, AvrDevice *c);
01691 int operator()();
01692 int Trace();
01693 };
01694
01695 class avr_op_SBRS: public DecodedInstruction
01696 {
01697
01698
01699
01700
01701
01702
01703
01704
01705
01706
01707 protected:
01708 unsigned char R1;
01709 unsigned char Kbit;
01710
01711 public:
01712 avr_op_SBRS(word opcode, AvrDevice *c);
01713 int operator()();
01714 int Trace();
01715 };
01716
01718 class avr_op_SLEEP: public DecodedInstruction
01719 {
01720
01721
01722
01723
01724
01725
01726
01727
01728
01729
01730
01731
01732
01733 public:
01734 avr_op_SLEEP(word opcode, AvrDevice *c);
01735 int operator()();
01736 int Trace();
01737 };
01738
01739 class avr_op_SPM: public DecodedInstruction
01740 {
01741
01742
01743
01744
01745
01746
01747
01748
01749
01750
01751 public:
01752 avr_op_SPM(word opcode, AvrDevice *c);
01753 int operator()();
01754 int Trace();
01755 };
01756
01757 class avr_op_STD_Y: public DecodedInstruction
01758 {
01759
01760
01761
01762
01763
01764
01765
01766
01767
01768
01769 protected:
01770 unsigned char R1;
01771 unsigned char K;
01772
01773 public:
01774 avr_op_STD_Y(word opcode, AvrDevice *c);
01775 int operator()();
01776 int Trace();
01777 };
01778
01779 class avr_op_STD_Z: public DecodedInstruction
01780 {
01781
01782
01783
01784
01785
01786
01787
01788
01789
01790
01791 protected:
01792 unsigned char R1;
01793 unsigned char K;
01794
01795 public:
01796 avr_op_STD_Z(word opcode, AvrDevice *c);
01797 int operator()();
01798 int Trace();
01799 };
01800
01801 class avr_op_STS: public DecodedInstruction
01802 {
01803
01804
01805
01806
01807
01808
01809
01810
01811
01812
01813 protected:
01814 unsigned char R1;
01815
01816 public:
01817 avr_op_STS(word opcode, AvrDevice *c);
01818 int operator()();
01819 int Trace();
01820 };
01821
01822 class avr_op_ST_X: public DecodedInstruction
01823 {
01824
01825
01826
01827
01828
01829
01830
01831
01832
01833
01834 protected:
01835 unsigned char R1;
01836
01837 public:
01838 avr_op_ST_X(word opcode, AvrDevice *c);
01839 int operator()();
01840 int Trace();
01841 };
01842
01843 class avr_op_ST_X_decr: public DecodedInstruction
01844 {
01845
01846
01847
01848
01849
01850
01851
01852
01853
01854
01855 protected:
01856 unsigned char R1;
01857
01858 public:
01859 avr_op_ST_X_decr(word opcode, AvrDevice *c);
01860 int operator()();
01861 int Trace();
01862 };
01863
01864 class avr_op_ST_X_incr: public DecodedInstruction
01865 {
01866
01867
01868
01869
01870
01871
01872
01873
01874
01875
01876 protected:
01877 unsigned char R1;
01878
01879 public:
01880 avr_op_ST_X_incr(word opcode, AvrDevice *c);
01881 int operator()();
01882 int Trace();
01883 };
01884
01885 class avr_op_ST_Y_decr: public DecodedInstruction
01886 {
01887
01888
01889
01890
01891
01892
01893
01894
01895
01896
01897 protected:
01898 unsigned char R1;
01899
01900 public:
01901 avr_op_ST_Y_decr(word opcode, AvrDevice *c);
01902 int operator()();
01903 int Trace();
01904 };
01905
01906 class avr_op_ST_Y_incr: public DecodedInstruction
01907 {
01908
01909
01910
01911
01912
01913
01914
01915
01916
01917
01918 protected:
01919 unsigned char R1;
01920
01921 public:
01922 avr_op_ST_Y_incr(word opcode, AvrDevice *c);
01923 int operator()();
01924 int Trace();
01925 };
01926
01927 class avr_op_ST_Z_decr: public DecodedInstruction
01928 {
01929
01930
01931
01932
01933
01934
01935
01936
01937
01938
01939 protected:
01940 unsigned char R1;
01941
01942 public:
01943 avr_op_ST_Z_decr(word opcode, AvrDevice *c);
01944 int operator()();
01945 int Trace();
01946 };
01947
01948 class avr_op_ST_Z_incr: public DecodedInstruction
01949 {
01950
01951
01952
01953
01954
01955
01956
01957
01958
01959
01960 protected:
01961 unsigned char R1;
01962
01963 public:
01964 avr_op_ST_Z_incr(word opcode, AvrDevice *c);
01965 int operator()();
01966 int Trace();
01967 };
01968
01969 class avr_op_SUB: public DecodedInstruction
01970 {
01971
01972
01973
01974
01975
01976
01977
01978
01979
01980
01981 protected:
01982 unsigned char R1;
01983 unsigned char R2;
01984 HWSreg *status;
01985
01986 public:
01987 avr_op_SUB(word opcode, AvrDevice *c);
01988 virtual unsigned char GetModifiedR() const;
01989 int operator()();
01990 int Trace();
01991 };
01992
01993 class avr_op_SUBI: public DecodedInstruction
01994 {
01995
01996
01997
01998
01999
02000
02001
02002
02003
02004
02005 protected:
02006 unsigned char R1;
02007 HWSreg *status;
02008 unsigned char K;
02009
02010 public:
02011 avr_op_SUBI(word opcode, AvrDevice *c);
02012 virtual unsigned char GetModifiedR() const;
02013 int operator()();
02014 int Trace();
02015 };
02016
02017 class avr_op_SWAP: public DecodedInstruction
02018 {
02019
02020
02021
02022
02023
02024
02025
02026
02027
02028
02029 protected:
02030 unsigned char R1;
02031
02032 public:
02033 avr_op_SWAP(word opcode, AvrDevice *c);
02034 int operator()();
02035 int Trace();
02036 };
02037
02038 class avr_op_WDR: public DecodedInstruction
02039 {
02040
02041
02042
02043
02044
02045
02046
02047
02048
02049
02050
02051
02052 public:
02053 avr_op_WDR(word opcode, AvrDevice *c);
02054 int operator()();
02055 int Trace();
02056 };
02057
02058 class avr_op_BREAK: public DecodedInstruction
02059 {
02060
02061
02062
02063
02064
02065
02066
02067
02068
02069
02070
02071
02072 public:
02073 avr_op_BREAK(word opcode, AvrDevice *c);
02074 int operator()();
02075 int Trace();
02076 };
02077
02078 class avr_op_ILLEGAL: public DecodedInstruction
02079 {
02080
02081
02082 public:
02083 avr_op_ILLEGAL(word opcode, AvrDevice *c);
02084 int operator()();
02085 int Trace();
02086 };
02087
02088 #endif
02089