ucsim-0.2.37-pre3 into cvs
[fw/sdcc] / sim / ucsim / z80.src / regsz80.h
1 /*
2  * Simulator of microcontrollers (regsz80.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 REGSAVR_HEADER
29 #define REGSAVR_HEADER
30
31 #include "ddconfig.h"
32
33
34 struct t_regpair
35 {
36 #ifdef WORDS_BIGENDIAN
37   TYPE_UBYTE h;
38   TYPE_UBYTE l;
39 #else
40   TYPE_UBYTE l;
41   TYPE_UBYTE h;
42 #endif
43 };
44
45 #define DEF_REGPAIR(BIGNAME,smallname) \
46   union { \
47     TYPE_UWORD BIGNAME; \
48     struct t_regpair smallname; \
49   }
50
51 struct t_regs
52 {
53   TYPE_UBYTE A;
54   TYPE_UBYTE F;
55   DEF_REGPAIR(BC, bc);
56   DEF_REGPAIR(DE, de);
57   DEF_REGPAIR(HL, hl);
58   TYPE_UWORD IX;
59   TYPE_UWORD IY;
60   TYPE_UWORD SP;
61 };
62
63 #define BIT_C   0x01
64 #define BIT_P   0x04
65 #define BIT_A   0x10
66 #define BIT_Z   0x40
67 #define BIT_S   0x80
68
69
70 #endif
71
72 /* End of z80.src/regsz80.h */