Instructions
174Compiler
© 2013 Conrad Electronic
tion is executed "signed".
If one of the operands is of the float type then the result is also of the float type. If
one of the two operands happens to be of the 8 Bit or 16 Bit data type then it will be
converted into a float data type prior to the operation.
4.2.4 Variables
Variables can take on various values depending on the Data Type by which they have been defined.
A variable definition appears as follows:
Type Variable Name;
When several variables of the same type need to be defined then these variables can be stated sep-
arated by commas:
Typ Name1, Name2, Name3, ...;
As types are allowed: char, unsigned char, byte, int, unsigned int, word, long, dword, float
Examples:
int a;
int i,j;
float xyz;
Integer variables may have decimal figure values or Hex values assigned to. With Hex values the
characters "0x" will be placed ahead of the figure. Binary numbers can be created with the prefix
"0b". With variables of the sign afflicted data type negative decimal figures can be assigned to by
putting a minus sign ahead of the figure.
Numbers without period or exponent are normally of type signed integer. To explicitly define an
unsigned integer write an "u" direct after the number. To declare a number to be 32-Bit, either the
value is greater 65535 or put an "l" after the number. Can be combined with "u" from unsigned.
Examples:
char c;
word a;
int i,j;
c=5;
c='a'; // single quotes defines the ASCII value
a=0x3ff; // hex digits are always unsigned
x=0b1001; // binary number
a=50000u; // unsigned
a=100ul; // unsigned 32 Bit (dword)
i=15; // default is signed
j=-22; // signed