----------------------------------------------------------------------------
           IDC - short overview of the built-in language
----------------------------------------------------------------------------

IDC language is a C-like language. It has the same lexical tokens as C :
character set,constants,identifiers,keywords, etc. All variables in IDC are
automatic local variables. A variable can contain:

  - a 32-bit signed long integer
  - a character string (max 255 characters long)
  - a floating point number (extra precision, up to 25 decimal digits)

A program in IDC consists of function declarations. A function in IDC returns
a value. There are 2 kinds of functions:

  - built-in functions
  - user-defined functions

Here is how a function is declared :

  static func(arg1,arg2,arg3) {
    ...
  }

where arg1,arg2,arg3 are the function parameters,'func' is the function name.
It is not nesessary to specify the types of the parameters because any variable
can contain a string or a number.

Here is how a variable is declared :

  auto var;

This declaration introduces a variable named 'var'. It can contain a string
or a number. All C and C++ keywords are reserved and cannot be used as
a variable name. The scope of the variable is the function where it is defined.

IDC supports the following statements:

  if (expression) statement
  if (expression) statement else statement
  for ( expr1; expr2; expr3 ) statement
  while (expression) statement
  do statement while (expression);
  break;
  continue;
  return <expr>;
  return;					the same as 'return 0;'
  { statements... }
  expression;					 (expression-statement)
  ;						 (empty statement)

In expressions you may use almost all C operations except:
  ++,--
  complex assigment operations as '+='
  , (comma operation)

You may use the following construct in the expressions:

  [ s, o ]

Suppose one wants to calculate the linear (effective) address for segment 's'
offset 'o'. Here is how it is done :

  (s << 4) + o

If a string constant is specified as 's', it denotes a segment by its name.

There are 3 type conversion operations:

  long( expr )		floating point number is truncated during conversion
  char( expr )
  float( expr )

However, all type conversions are made automatically:

  - addition:

if both operands are strings, string addition is performed (strings  are
concatenated);

if floating point operand exists, both operands are converted to floats;
otherwise both operands are converted to longs;

  - subtraction/multiplication/division:
  
if  floating  point  operand  exists,  both  operands are converted to
floats; otherwise both operands are converted to longs;

  - comparisions (==,!=, etc):

if both operands are strings, string comparision is performed; 
if floating point operand exists, both operands are converted to floats;
otherwise both operands are converted to longs;

  - all other operations:

operand(s) are converted to longs;

Built-in functions

 For the list of built-in functions please see file IDC.IDC
