awlsim - STEP 7 compatibility
=============================

The execution of AWL/STL programs by awlsim is supposed to be fully
compatible with the execution of compiled AWL/STL programs on the real
Siemens S7 CPU.
However, there currently are some known differences. These are listed below.
Any undocumented difference between awlsim and STEP 7 is considered to be a
bug that should be reported.

- awlsim does not implement all features of STEP 7, yet.
  See TODO.txt for a list of missing features.

- Semicolons: AWL/STL requires semicolons (;) after each declaration,
  initialization and statement. As an awlsim convenience service, terminating
  semicolons can be omitted in AWL/STL statements.
  Data declarations and initializations (in DBs and FB/FC interfaces), however,
  must end with a semicolon.

- Changing a symbol's address or data type in Awlsim does change the AWL/STL
  semantics of the code that uses this symbol.
  This is due to source text being the first class program object in Awlsim.
  (In STEP 7 first class program objects are the compiled blocks.)
  Awlsim compiles and reinterpretes the symbol information of the plain source
  text on each download to the CPU.
  The same thing happens in STEP 7, if a source text is imported.

- awlsim does not compile AWL/STL to MC7 code and it cannot execute MC7 code.
  On startup awlsim translates the AWL/STL code to an awlsim specific in-memory
  representation of the code. There is no byte-code representation of this
  code.

- Some key concepts, such as CALL or memory indirect addressing are implemented
  natively in awlsim. This means to improve runtime performance in awlsim
  CALL is not a macro. From a user's perspective there should not be any
  functional difference visible in CALL. Any such difference is a bug.
  However, due to these constraints, it is not possible to call FBs or FCs
  with an interface (IN/OUT/INOUT variables) via UC or CC instructions.

- Undefined behavior is not emulated.
  For example: If reading uninitialized L-stack space in STEP 7 always yields
  a certain reproducible result, that does not mean that this AWL/STL code does
  the same thing in awlsim.
  Reading uninitialized TEMP-memory is undefined.
