Imported Upstream version 2.9.0
[debian/cc1111] / sim / ucsim / avr.src / inst.cc
1 /*
2  * Simulator of microcontrollers (inst.cc)
3  *
4  * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
5  * 
6  * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
7  *
8  */
9
10 /* This file is part of microcontroller simulator: ucsim.
11
12 UCSIM is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
16
17 UCSIM is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with UCSIM; see the file COPYING.  If not, write to the Free
24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
25 02111-1307, USA. */
26 /*@1@*/
27
28 #include "ddconfig.h"
29
30 // local
31 #include "avrcl.h"
32 #include "regsavr.h"
33
34
35 /*
36  * No Instruction
37  * NOP
38  * 0000 0000 0000 0000
39  *----------------------------------------------------------------------------
40  */
41
42 int
43 cl_avr::nop(t_mem code)
44 {
45   return(resGO);
46 }
47
48
49 /*
50  * Sleep
51  * SLEEP
52  * 1001 0101 100X 1000
53  *____________________________________________________________________________
54  */
55
56 int
57 cl_avr::sleep(t_mem code)
58 {
59   sleep_executed= 1;
60   return(resGO);
61 }
62
63
64 /*
65  * Watchdog Reset
66  * WDR
67  * 1001 0101 101X 1000
68  *____________________________________________________________________________
69  */
70
71 int
72 cl_avr::wdr(t_mem code)
73 {
74   //FIXME
75   return(resGO);
76 }
77
78
79 /*
80  * Set all bits in Register
81  * SER Rd  16<=d<=31
82  * 1110 1111 dddd 1111
83  *____________________________________________________________________________
84  */
85
86 int
87 cl_avr::ser_Rd(t_mem code)
88 {
89   t_addr d= (code&0xf0)>>4;
90   t_mem data= 0xff;
91   ram->write(d, data);
92   return(resGO);
93 }
94
95
96 /* End of avr.src/inst.cc */