Msg: 5493 *Conference*

10-20-94 18:03:03

From: RON WIESEN

To : ALL

Subj: SIMPLE .CE

.CO FORM CONVERSION TO SIMPLE .CE FORM
 
Two forms of a m/l program are shown side by side below.  The simple .CE form
may be run, via the operating system, in the conventional .CO fashion with a
bit more HIMEM requirement than for the .CO form.  When run via an Executive
program, the .CE form has no HIMEM requirement and simply runs in place.  The
Executive program is a .CO form with TOP and LEN confined to the "Prev Screen
Buffer" so that it has no HIMEM requirement.  The user runs the Executive which
prompts him for the file name of the .CE form program.  The Executive adjusts
dynamic points of the .CE form program, passes execution control to it, and
upon return of execution control restores the dynamic points to their original
values.
 
The simple .CE form takes advantage of the structural statistics of simple m/l
programs which don't exceed the "Restrictions" listed below.  Less simple .CE
forms are possible and demand a more complex Executive program.
 
Original .CO form   .Simple .CE form
....................................
                    .          +---+
                    .         *|TOP|
                    .          +---+
                    .         *|LEN|
                    .          +---+
                    .          |EXE|
                    .          +---+
                    . oTOP  h +| A |
         +---+      . |        +---+
         |TOP|      . |       +| B |
         +---+      . |        +---+
         |LEN|      . |       +| C |
         +---+      . |        +---+
         |EXE|      . |       +| 0 |
         +---+      . |        +---+
oTOP, EXE|   |HIMEM . |    |EXE|   |
|        |   |      . |    A   |   |
|        +---+      . |    |   +---+
|       X|   |      . |    v  X|   |
|        +---+      . |    |   +---+
|        |   |      . L    |   |   |
|        |   |      . E    |   |   |
|        |   |      . N    B   |   |
|        |   |      . |    |   |   |
L        |   |      . |    |   |   |
E        +---+      . |    |   +---+
N       Y|   |      . |    v  Y|   |
|        +---+      . |    |   +---+
|        |   |      . |    |   |   |
|        |   |      . |    C   |   |
|        |   |      . |    |   |   |
|        +---+      . |    |   +---+
|       Z|   |      . |    v  Z|   |
|        +---+      . |        +---+
|        |   |      . |        |   |
|        |   |      . |        |   |
v     End+---+      . v     End+---+
 
Key:
* = altered from .CO form
+ = inserted table to dynamic points h = HIMEM for conventional .CO run X, Y, Z
= adjusted/restored by Executive prior/after .CE run
 
Notes: 1.  Points X, Y, and Z are 2-byte internal program addresses (e.g.,
CALL/JMP operands) found by technical folks who analyze original .CO form.
Under .CE run via Executive, these are dynamic. 2.  A, B, and C are 1-byte
entries in a table of relative offsets to dynamic points.  They are chained
where the first is relative to EXE, the second is relative to the first, and so
on. 3.  The end of the table of relative offsets contains zero. 4.  The
absolute program End address is the same (End=TOP+LEN) in both forms.
 
Restrictions: 1.  No dynamic points lay ahead of EXE.  Data may lay ahead of
EXE (TOP and EXE differ in .CO form), but it must not be dynamic. 2.  The span
between all adjacent pairs of dynamic points is less than 256. 3.  The program
must not move in memory during its execution.  Thus file kill, append, and
create must not occur either as a direct result of execution or indirectly via
calls to the operating system. 4.  The program must use no RST 7 hooks which
link to internal program addresses.
 
-= Ron =-