1 /* Hey EMACS -*- linux-c -*- */
2 /* $Id: main.c 245 2004-05-23 20:45:43Z roms $ */
3 
4 /*  TiEmu - Tiemu Is an EMUlator
5  *
6  *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Lievin
7  *  Copyright (c) 2001-2003, Romain Lievin
8  *  Copyright (c) 2003, Julien Blache
9  *  Copyright (c) 2004, Romain Li�vin
10  *  Copyright (c) 2005, Romain Li�vin
11  *
12  *  This program 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  *  This program 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 this program; if not, write to the Free Software
24  *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
25  */
26 
27 #ifndef __BITS__
28 #define __BITS__
29 
30 #define bit_get(v,b)	(((v) & (1 << (b))) >> (b))
31 #define bit_set(v,b)	v |=  (1 << (b));
32 #define bit_clr(v,b)	v &= ~(1 << (b));
33 
34 #define bit_tst(v,b)    ((v) &  (1 << b))
35 #define bit_chg(v,b,s)	{                           \
36                             if(s)                   \
37                                 { bit_set(v,b); }   \
38                             else                    \
39                                 { bit_clr(v,b); }   \
40                         }
41 
42 #endif
43