2018-02-06 03:40:00 +00:00
|
|
|
C02 for C programmers
|
|
|
|
|
|
|
|
TYPES
|
|
|
|
|
|
|
|
C02 only supports one data type: unsigned char.
|
|
|
|
|
|
|
|
POINTERS
|
|
|
|
|
|
|
|
C02 does not support pointer type variables or parameters. However, the
|
|
|
|
address-of operator may be used in function calls and the inline
|
|
|
|
statement.
|
|
|
|
|
2018-03-07 04:35:47 +00:00
|
|
|
DIRECTIVES
|
|
|
|
|
|
|
|
C02 does not use a preprocessor. All directives are directly processed
|
|
|
|
by the compiler.
|
|
|
|
|
|
|
|
CONSTANTS
|
|
|
|
|
2018-03-07 16:38:22 +00:00
|
|
|
The syntax of the const keyword in C02 differs from that use in standard C.
|
|
|
|
In C02, all constant names are prefixed with a # symbol.
|
2018-03-07 04:35:47 +00:00
|
|
|
|
|
|
|
ENUMERATION
|
|
|
|
|
|
|
|
Instead of the enum keyword, C02 uses the #enum directive. Values may
|
|
|
|
not be specified when defining enumerated constants.
|
|
|
|
|
2018-02-06 03:40:00 +00:00
|
|
|
DECLARATIONS
|
|
|
|
|
|
|
|
Variable and function names may be no more than six characters in length.
|
|
|
|
Multiple variable declarations separated by commas are allowed.
|
|
|
|
|
|
|
|
A variable in a declaration may be initialized by following it with an
|
|
|
|
equal sign and a constant, however this declaration is done at compile
|
|
|
|
time, so no re-initialization will occur during code execution.
|
|
|
|
|
|
|
|
Array declarations using bracket syntax specify the upper bound, rather
|
|
|
|
than the array size. Therefore, the array will be allocated with one more
|
|
|
|
element than the specified number.
|
|
|
|
|
|
|
|
EXPRESSIONS
|
|
|
|
|
|
|
|
C02 supports the addition, subtraction, bitwise-and, bitwise-or, and
|
|
|
|
exclusive-or operators. The multiplication, division, and binary shift
|
|
|
|
operators are not supported. These can be implemented through functions.
|
|
|
|
|
|
|
|
STATEMENTS
|
|
|
|
|
|
|
|
Instead of the switch statement, C02 uses the select statement. The
|
|
|
|
select statement works almost identically to the switch statement except
|
2018-03-07 04:35:47 +00:00
|
|
|
that case blocks do not fall through.
|