ucsim-0.2.37-pre3 into cvs
[fw/sdcc] / sim / ucsim / sim.src / itsrccl.h
1 /*
2  * Simulator of microcontrollers (itsrccl.h)
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 #ifndef ITSRCCL_HEADER
29 #define ITSRCCL_HEADER
30
31 #include "pobjcl.h"
32 #include "stypes.h"
33
34
35 /*
36  * Represents source of interrupt
37  */
38
39 class cl_it_src: public cl_base
40 {
41 public:
42   uchar ie_mask;  // Mask in IE register
43   uchar src_reg;  // Register in SFR of source
44   uchar src_mask; // Mask of source bit in src_reg
45   uint  addr;     // Address of service routine
46   bool  clr_bit;  // Request bit must be cleared when IT accepted
47   char  *name;    // For debug
48   bool  active;   // Acceptance can be disabled
49
50   cl_it_src(uchar Iie_mask,
51             uchar Isrc_reg,
52             uchar Isrc_mask,
53             uint  Iaddr,
54             bool  Iclr_bit,
55             char  *Iname);
56   ~cl_it_src(void);
57
58           bool is_active(void);
59   virtual void set_active_status(bool Aactive);
60   virtual void activate(void);
61   virtual void deactivate(void);
62 };
63
64
65 /*
66  * This class is used to follow levels of accepted interrupts
67  * It used on a stack of active interrupt services (it_levels of cl_uc)
68  */
69
70 class it_level: public cl_base
71 {
72 public:
73   int level;
74   uint addr;
75   uint PC;
76   class cl_it_src *source;
77 public:
78   it_level(int alevel, uint aaddr, uint aPC, class cl_it_src *is);
79 };
80
81
82 #endif
83
84 /* End of itsrccl.h */