
	IDC - a built-in language
	=========================

IDC language is a C-like language. It has the same lexical tokens as C does:
character set,constants,identifiers,keywords, etc. All variables in IDC are
automatic local variables (sic!). A variable can contain:
  - a 32-bit signed long integer
  - a character string (max 255 characters long)
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

A function is declared in this way:

  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.

A variable is declared in this way:

  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 variable is defined up to end of function.

In IDC there are 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 can use almost all C operations except:
  ++,--
  complex assigment operations as '+='
  , (comma operation)

You can use the following construct in the expressions:

  [ s, o ]

This means to calculate linear (effective) address for segment 's' offset 'o'.
The calculation is made using the following formula:

  (s << 4) + o

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

There are 2 type conversion operations:

  long( expr )
  char( expr )

However, all type conversions are made automatically:
  - operand(s) are converted to 'long'
  - the operation is performed.

Exceptions:
 1. binary '+' operation. If the first operand is string type, the second
    operand is converted to a string and the operands are concatenated.
 2. relational operations (such as ==,!=, etc.) If both operands are strings,
    the string comparision is performed, otherwise - they are converted to
    numbers.

Built-in functions
------------------

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