Техническая Спецификация для C Control I programmer/evolution Board 8-12 Vdc Inputs / outputs - Program memory 2 kB 198302

Модели
198302
Скачать
Страница из 40
20
Variablen und Konstanten
Variablen und Konstanten sind Objekte des Informationsverarbeitungsprozesses.
In CCBASIC speichern beide einen numerischen Wert. Während der Wert einer Kon-
stante einmal angegeben wird und dann unverändert bleibt, kann sich der Wert einer
Variablen im Lauf des Programms beliebig oft ändern. Konstanten können in CCBA-
SIC in dezimaler, hexadezimaler und binärer Form angegeben werden. Die Syntax
für Hexadezimal- und Binärzahlen sei hier am Beispiel der Zahl 46 (dezimal) gezeigt:
&H2E
&B101110
Außerdem können per DEFINE-Zeilen (siehe unten) symbolische Konstanten verein-
bart werden. Auf Variablen wird stets über ihren Bezeichner zugegriffen. Dieser
Bezeichner muß vor der ersten Verwendung der Variable im Programm in einer DEFI-
NE-Zeile definiert werden.
Label
Label markieren bestimmte Punkte in der Folge der Programmoperationen. Label
sind Ziele von Sprungoperation innerhalb eines Algorithmus. In CCBASIC stehen
Label am Anfang einer Zeile und beginnen
stets mit einem Doppelkreuz, dann folgt - ohne Leerzeichen - der Bezeichner des
Labels.
Das Beispiel zeigt die Definition des Labels ,,Labell” und die Verwendung in einem
Sprungbefehl: 
#labell . . .
GOTO labell
Terme
Ein Term ergibt sofort (als Variable oder Konstante) oder durch Berechnung einen
bestimmten Wert. Terme sind Teile von Anweisungen und stehen beispielsweise bei
der Zuweisung eines Wertes an eine Variable rechts des Zuweisungszeichens
,,=".Terme werden durch Kombinationen von Operanden und Operatoren gebildet.
a +b=(x - 13) * 10
Operanden und Operatoren
Ein Operand ist in der Grundform entweder eine Konstante, eine Variable oder ein
Funktionsaufruf, kann aber auch selbst wieder ein aus Operanden und Operatoren
zusammengesetzter Term sein. Operatoren bezeichnen Rechenoperationen, die mit
den umstehenden Operanden auszuführen sind. Dabei gibt es eine definierte Rang-
folge der Operatoren (siehe Befehlsbeschreibung), die die Reihenfolge der Berech-
nungen bestimmt.
61
Values from 1 to 24 (24 Bytes) are permitted for nr.
DEFINE identifier WORD[nrl
may be permitted by the compiler but not used as the MICRO is strictly byte-orien-
tated.
The use of WORD variables can lead to uncontrolled behaviour of the MICRO.
If for byte definitions the cell statement [nr] is left out, the compiler will take over the
division of the storage area.
DEFINE a BYTE
DEFINE c BYTE
The automatic division of the variables in the memory by the compiler begins at cell
number 1. For the definition of further bits and bytes with statement of the cell num-
ber, it is necessary to watch out for undesired overlapping. An already defined vari-
able identifier may not be defined for a second time.
Definition of digital ports
Ports as also variables are accessed in CCBASIC,. Here again, each port used has to
be previously defined.
• Definition of one of the 6 digital ports
DEFINE identifier PORT[nr]
CAUTION:
For the C-control MICRO, all ports can accept the function of a digital port. 
The ports available are PORT1, PORT2, PORT3, PORT4, PORT5, PORT6.
Although other ports are accepted by the development environment (to preserve the
compatibility to C-control I ), their use leads to absolutely uncontrollable behaviour of
the MICRO.
DEFINE identifier BYTEPORT[nr]
DEFINE identifier WORDPORT[nr]
can be permitted by the compiler but not used as the MICRO is strictly byte-orien-
tated.
Their use can lead to uncontrolled behaviour of the MICRO.