Merge branch ucsim-034-pre3 to main trunk; new version 0.4
[fw/sdcc] / sim / ucsim / xa.src / xacl.h
1 /*
2  * Simulator of microcontrollers (xacl.h)
3  *
4  * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
5  *
6  * Written by Karl Bongers karl@turbobit.com
7  * 
8  * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
9  *
10  */
11
12 /* This file is part of microcontroller simulator: ucsim.
13
14 UCSIM is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
18
19 UCSIM is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 GNU General Public License for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with UCSIM; see the file COPYING.  If not, write to the Free
26 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
27 02111-1307, USA. */
28 /*@1@*/
29
30 #ifndef XACL_HEADER
31 #define XACL_HEADER
32
33 #include "uccl.h"
34
35 #include "regsxa.h"
36
37 /*
38  * Base type of XA microcontrollers
39  */
40
41 class cl_xa: public cl_uc
42 {
43 public:
44   cl_mem *ram;
45   cl_mem *rom;
46   struct t_regs regs;
47
48   // for now make it as simple as possible
49   TYPE_UBYTE mem_direct[1024*2];
50 #ifndef WORDS_BIGENDIAN
51   TYPE_UWORD *wmem_direct;  /* word pointer at mem_direct */
52 #endif
53
54 public:
55   cl_xa(class cl_sim *asim);
56   virtual int init(void);
57   virtual char *id_string(void);
58
59   virtual t_addr get_mem_size(enum mem_class type);
60   virtual void mk_hw_elements(void);
61
62   virtual struct dis_entry *dis_tbl(void);
63
64   virtual int inst_length(t_addr addr);
65   virtual int inst_branch(t_addr addr);
66   virtual int longest_inst(void);
67
68   virtual int get_disasm_info(t_addr addr,
69                        int *ret_len,
70                        int *ret_branch,
71                        int *immed_offset,
72                        int *parms,
73                        int *mnemonic);
74
75   virtual char *disass(t_addr addr, char *sep);
76   virtual void print_regs(class cl_console *con);
77
78   virtual int exec_inst(void);
79   virtual int get_reg(int word_flag, unsigned int index);
80
81 #include "instcl.h"
82 };
83
84
85 #endif
86
87 /* End of xa.src/xacl.h */