TERRA Datentechnik                                           17-Feb-92
A. Gorrengourt
======================================================================

Subject: Debugging WHILE loops
------------------------------

    The V4 compiler generates about the following code for a WHILE
    statement.

    (a) When optimizing for space (or optimization off):

        WHILE cond DO            JMP L2
          xxx                L1: Code for "xxx"
        END (*WHILE*);       L2: Test "cond"
                                 JMP TRUE L1

    (b) When optimizing for speed/execution time (default):

        WHILE cond DO            Test "cond"
                                 JMP FALSE L3
          xxx                L1: Code for "xxx"
        END (*WHILE*);           Test "cond"
                                 JMP TRUE L1
                             L3:

    Due to the above, setting a breakpoint on the line containing
    the "WHILE ..." will cause only one initial break. If one intends
    to stop once for each iteration, a breakpoint should be set on
    the line containg the "END (*WHILE*);". Note that the loop code
    "xxx" has not yet been executed when stopping there the first
    time.

                               * * *