C Control I programmer/evolution Board 8-12 Vdc Inputs / outputs - Program memory 2 kB 198302 Ficha De Dados

Códigos do produto
198302
Página de 40
58
Apart from this, symbolic constants can be agreed by virtue of DEFINE lines (see
below). Variables are accessed through their identifier. Before the variables are used
for the first time in the program, this identifier has to be defined in a DEFINE line.
Labels
Labels mark certain points in the order of the program operations. Labels are goals
of branch operations within an algorithm. In CCBASIC, labels stand at the beginning
of a line and always start with a "hash2, followed by – without a blank – the identifier
of the label.
The example shows the definition of the label "Labell” and is used in a branch com-
mand.
#labell . . .
GOTO labell
Terms
A term results immediately (as variable or constant) or by calculation in a certain val-
ue. Terms are parts of instructions and are positioned, for example for the assign-
ment of a value to a variable, to the right of the assignment symbol "=”. Terms are
formed by combinations of operands and operators.
a +b=(x - 13) * 10
Operands and operators
In its basic form, an operand is either a constant, a variable or a function reference
but can also itself be a term composed of operands and operators. Operators desig-
nate arithmetic operations which are to be executed by means of the surrounding
operands. There is thereby a defined ranking order for the operators (see description
of commands) which determines the order of the calculations.
Functions
A function carries out a defined operation – for example a calculation – and, when
called up, supplies a result value. Most functions expect one or more arguments
which are stated in round brackets "( )” after the function identifier and separated by
commas. Some functions are called up without an argument. In this case, no round
brackets are required. 
RAND
EOF 
In CCBASIC all functions supported are pre-defined. Their identifiers belong to the
reserved words. The formulation of user-defined functions is not envisaged in
CCBASIC.
23
gramms gespeichert. Die 24 Bytes können je nach Bedarf auch bitweise verwendet
werden. Im Gegensatz zum Standard-BASIC müssen in CCBASIC alle vom Pro-
gramm benutzten Variablen vor ihrer ersten Verwendung definiert werden. Dabei ist
der Datentyp zu spezifizieren (Bit, oder Byte) und kann (für Bits muß!) eine Speicher-
zellennummer angegeben werden.
Der Anwender muß selbst darauf achten, daß keine unerwünschten Überlappungen
bei der Vergabe der Speicherplätze entstehen, da es sonst zum gegenseitigen über-
schreiben der Variablen kommen kann. Beispielsweise belegen bit[l8] und byte[2]
jeweils einen Teil der Zelle 2 des Speicherbereiches.
• Definition einer Bitvariablen:
DEFINE bezeichner BIT [nr]
Dabei sind für nr Werte von 1 bis 192 (24 Bytes mit je 8 Bit) zulässig.
• Definition einer Bytevariablen mit Zellennummer:
DEFINE bezeichner BYTE[nrl
Dabei sind für nr Werte von 1 bis 24 (24 Bytes) zulässig.
DEFINE bezeichner WORD[nrl
werden vom Compieler zwar zugelassen dürfen, aber nicht verwendet werden, da
die MICRO strikt Byte orientiert ist.
Die Verwendung Word-Variablen kann zu unkontrolliertem Verhalten der MICRO
führen
Wenn bei Bytedefinitionen die Zellenangabe [nr] weggelassen wird, übernimmt der
Compiler die Aufteilung auf den Speicherbereich. 
DEFINEa BYTE
DEFINE c BYTE
Die automatische Aufteilung der Variablen auf den Speicher durch den Compiler
beginnt bei Zellennummer 1.  Bei Definition weiterer Bits und Bytes  mit Angabe der
Zellennummer ist wieder auf unerwünschte Überlappung zu achten. Ein bereits defi-
nierter Variablenbezeichner darf nicht ein zweites Mal definiert werden.