
The memory location must be in the general purpose data memory. The
offset of it starts from 0
×
20.
All variables implemented by the Holtek C compiler are static unless they
are declared as external variables. Note that both static and external
variables will not be initialized to zero by default.
Constants
A constant is any literal number, single character or character string.
Integer constants
An integer constant is evaluated as int type, a long constant is terminated
with l or L. Unsigned constants are terminated with a u or U, the suffix ul
or UL indicates unsigned long. The value of an integer constant can be
specified with the following forms:
Binary constant: preceding the number by 0b or 0B
Octal constant: preceding the number by 0 (zero)
Hexadecimal constant: preceding the number by 0x or 0X
Others not included above are decimal
Character constants
A character constant is an integer, which is denoted by a single character
enclosed by single quotes. The value of a character constant is the numeric
value of the character in the machine’s character set. ANSI C escape
sequences are treated as a single character constant.
String constants
String constants are represented by zero or more characters (including the
ANSI C escape sequences) enclosed in double quotes. A string constant is
an array of characters and has an implied null (zero) value after the last
character. Hence, the total required storage is one more than the number
of the characters within the double quotes.
Enumeration constants
Another method for naming integer constants is called enumeration. For
example:
enum {PORTA, PORTB, PORTC} ;
Chapter 9 Holtek C Language
89
Summary of Contents for HT-IDE
Page 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Page 12: ...HT IDE User s Guide 2 ...
Page 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Page 24: ...HT IDE User s Guide 14 ...
Page 70: ...HT IDE User s Guide 60 ...
Page 76: ...HT IDE User s Guide 66 ...
Page 92: ...HT IDE User s Guide 82 ...
Page 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Page 94: ...HT IDE User s Guide 84 ...
Page 148: ...HT IDE User s Guide 138 ...
Page 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Page 154: ...HT IDE User s Guide 144 ...
Page 192: ...HT IDE User s Guide 182 ...
Page 194: ...HT IDE User s Guide 184 ...
Page 218: ...HT IDE User s Guide 208 ...
Page 235: ...P a r t V Appendix Part V Appendix 225 ...
Page 236: ...HT IDE User s Guide 226 ...
Page 250: ...HT IDE User s Guide 240 ...