Next: , Previous: , Up: Executive Assembler Introduction   [Index]


8.1.4 Assembling The Executive

The standalone interpreter collects its concerns in a struct x1f4_textport_type record and calls x1f4_fast_indexset to build the set of executive objects. When done, it adds to the set of functions available for the interpreted program the functions making available the program arguments and an extra exit function.

See struct x1f4_textport_type.

See x1f4_fast_indexset.

static int
init_xset(struct context_type *context_data)
{
    int status;
    struct x1f4_textport_type textport;
    unsigned textport_bits;

Hint the executive assembler of the error reporter:

    textport_bits = X1f4_TEXTPORT_TEXTFLAT;

See Executive Objects Set Generation Flags.

Set the first data type id for the types to be generated (list, file, etc):

    textport.lasttype_set.type = X1f4_E4_LAST;

Add the struct x1f4_lxtile_type library object constructors:

See struct x1f4_lxtile_type.

    textport.tilelong_set.lxtile_data = tiles;
    textport.tilelong_set.miss =
	sizeof(tiles) / sizeof(struct x1f4_lxtile_type);

See The Library Object Constructors.

Define two output function sets, one writing the standard output and one the standard error:

See Output Library.

See struct x1f4_lxnear_type.

    lxnear.nearpipe_set.textpipe_data = near_pipes;
    lxnear.nearpipe_set.miss = 2;

Described the error reporter:

See The Error Reporters.

    textport.textflat_set.data = context_data;
    textport.textflat_set.line = line_flat;
    textport.textflat_set.post = post_flat;
    textport.textflat_set.push = push_flat;

Add the address of the one int indicating whether temporaries need to be collected:

    textport.autodeck_set.class = &context_data->class;

Finally, construct the executive objects set:

    status = x1f4_fast_indexset
	(context_data->indexset_data, textport_bits, &textport);
    if (status) {
    } else {

and add the application specific aime functions:

See Adding The Specific Functions.

	status = type_fsdeck(context_data);
	if (status) {

Has that failed, destroy the created executive objects set:

	    x1f4_flat_indexset(context_data->indexset_data);
	} else {
	}
    }

    return status;
}

The disassembling of the executive is trivial:

static int
fini_xset(struct context_type *context_data)
{
    return x1f4_flat_indexset(context_data->indexset_data);
}

Next: The Resource Management, Previous: Program Parsing And Execution, Up: Executive Assembler Introduction   [Index]