-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathHITECH.H
68 lines (56 loc) · 1.99 KB
/
HITECH.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* Standard types for HI-TECH Software code
These types may need to be tuned for different
machines/compilers. Notes with each one indicate assumptions
that should be maintained for each type.
*/
/*
Turn ANSI on if the compiler supports function prototypes and
has the ANSI header files
<stdlib.h>
<string.h>
*/
#if HI_TECH_C
#define ANSI 1
#endif HI_TECH_C
/* shorthand types */
#define uchar unsigned char
#define ulong unsigned long
#define ushort unsigned short
#define uint unsigned int
/* useful, tuneable types. Change only if:
1) compiler does not support type, e.g. unsigned char.
2) compiler generates bad code for a particular type.
3) a larger type would generate faster code, e.g. byte counters
on the 65816 are inefficient code-wise.
*/
#define BOOL unsigned char /* boolean variable. Any integral type
will do. */
#define FAST char /* fast, small counter. Must permit
values -128 to 127 but may be larger. */
#define UFAST unsigned char /* fast, small unsigned counter. Must
permit values 0-255 at least */
#define BYTE unsigned char /* sizeof(BYTE) must == 1 */
#define INT_16 short /* signed, >= 16 bits */
#define UINT_16 unsigned short /* unsigned, >= 16 bits */
#define INT_32 long /* signed, >= 32 bits */
#define UINT_32 unsigned long /* unsigned, >= 32 bits */
/* Register variable selectors; REG1 is for things that must go
in registers at all costs, REG2 for things that should, REG3 for
things that could go in registers if there are any left over.
Ordering of declarations will of course come into it too.
*/
#if z80 /* only has one register variable */
#define REG1 register
#define REG2 auto
#define REG3 auto
#endif z80
#if i8086 /* only has two register variable */
#define REG1 register
#define REG2 register
#define REG3 auto
#endif i8086
#if i8096 || m68k /* lots of registers! */
#define REG1 register
#define REG2 register
#define REG3 register
#endif i8096 || m68k