4a697df5058b59e9617a6c67091e7a89e88077cd
[fw/sdcc] / sim / ucsim / xa.src / glob.h
1 /*
2  * Simulator of microcontrollers (glob.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 GLOB_HEADER
31 #define GLOB_HEADER
32
33 #include "stypes.h"
34
35
36 #if 0
37 enum {
38   REG,
39   IND_REG,
40   IND_REG_PLUS,
41   IND_REG_OFFSET,
42   DIRECT,
43   DATA8,
44   DATA16
45 };
46 #endif
47
48 enum {
49 BAD_OPCODE=0,
50 ADD,
51 ADDC,
52 SUB,
53 SUBB,
54 CMP,
55 AND,
56 OR,
57 XOR,
58 ADDS,
59 NEG,
60 SEXT,
61 MUL,
62 DIV,
63 DA,
64 ASL,
65 ASR,
66 LEA,
67 CPL,
68 LSR,
69 NORM,
70 RL,
71 RLC,
72 RR,
73 RRC,
74 MOVS,
75 MOVC,
76 MOVX,
77 PUSH,
78 POP,
79 XCH,
80 SETB,
81 CLR,
82 MOV,
83 ANL,
84 ORL,
85 BR,
86 JMP,
87 CALL,
88 RET,
89 Bcc,
90 JB,
91 JNB,
92 CJNE,
93 DJNZ,
94 JZ,
95 JNZ,
96 NOP,
97 BKPT,
98 TRAP,
99 RESET,
100 };
101
102 extern char *op_mnemonic_str[];
103
104 enum op_operands {
105    // the repeating common parameter encoding for ADD, ADDC, SUB, AND...
106   REG_REG         ,
107   REG_IREG        ,
108   IREG_REG        ,
109   REG_IREGOFF8    ,
110   IREGOFF8_REG    ,
111   REG_IREGOFF16   ,
112   IREGOFF16_REG   ,
113   REG_IREGINC     ,
114   IREGINC_REG     ,
115   DIRECT_REG      ,
116   REG_DIRECT      ,
117   REG_DATA8       ,
118   REG_DATA16      ,
119   IREG_DATA8      ,
120   IREG_DATA16     ,
121   IREGINC_DATA8   ,
122   IREGINC_DATA16  ,
123   IREGOFF8_DATA8  ,
124   IREGOFF8_DATA16 ,
125   IREGOFF16_DATA8 ,
126   IREGOFF16_DATA16,
127   DIRECT_DATA8    ,
128   DIRECT_DATA16   ,
129
130 // odd-ball ones
131   NO_OPERANDS,  // for NOP
132   C_BIT,
133   NOTC_BIT,
134   REG_DATA4,
135   IREG_DATA4,
136   IREGINC_DATA4,
137   IREGOFF8_DATA4,
138   IREGOFF16_DATA4,
139   DIRECT_DATA4
140 };
141
142 // table of dissassembled instructions
143 struct xa_dis_entry
144 {
145   uint  code, mask;
146   char  branch;
147   uchar length;
148 //  enum op_mnemonic mnemonic;
149 //  enum op_operands operands;
150   int mnemonic;
151   int operands;
152 };
153
154 extern struct dis_entry glob_disass_xa[];
155
156 extern struct xa_dis_entry disass_xa[];
157
158 #endif
159
160 /* End of xa.src/glob.h */