5762819 [rkeene@sledge /home/rkeene/devel/old/bc-dos/dc]$ cat -n dc-regdef.h
 1 /* 
 2  * definitions for dc's "register" declarations
 3  *
 4  * Copyright (C) 1994 Free Software Foundation, Inc.
 5  *
 6  * This program is free software; you can redistribute it and/or modify
 7  * it under the terms of the GNU General Public License as published by
 8  * the Free Software Foundation; either version 2, or (at your option)
 9  * any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you can either send email to this
18  * program's author (see below) or write to: The Free Software Foundation,
19  * Inc.; 675 Mass Ave. Cambridge, MA 02139, USA.
20  */
21 
22 #ifdef HAVE_LIMITS_H
23 # include <limits.h>    /* UCHAR_MAX */
24 #endif
25 
26 /* determine how many register stacks there are */
27 #ifndef DC_REGCOUNT
28 # ifndef UCHAR_MAX
29 #  define DC_REGCOUNT 256
30 # else
31 #  define DC_REGCOUNT (UCHAR_MAX+1)
32 # endif
33 #endif /* not DC_REGCOUNT */
34 
35 /* efficiency hack for masking arbritrary integers to 0..(DC_REGCOUNT-1) */
36 #if (DC_REGCOUNT & (DC_REGCOUNT-1)) == 0    /* DC_REGCOUNT is power of 2 */
37 # define regmap(r)  ((r) & (DC_REGCOUNT-1))
38 #else
39 # define regmap(r)  ((r) % DC_REGCOUNT)
40 #endif
5762820 [rkeene@sledge /home/rkeene/devel/old/bc-dos/dc]$

Click here to go back to the directory listing.
Click here to download this file.
last modified: 1995-03-30 07:33:08