10.13. Segment Modifiers

The memory block of a segment can be modified before it is passed on to its consumers. A segment-modifier takes a list of memory blocks as input and outputs a modified list of memory blocks.

The build in 'BasicUpstart' modifier adds a memory block in $0801 with a basic upstart program that jumps to a given address:

        .file [name="test.prg", segments="Code"]
        .segment Code [start=$8000, modify="BasicUpstart", _start=$8000]
        inc $d020
        jmp *-3

The 'modify' parameter assigns the 'BasicUpstart' modifier. As a convention, arguments to the modifier has a _ appended in front, so '_start' is an argument for the BasicUpstart modifier.

Users can write their own modifiers as plug-ins (Crunchers etc.) as shown in the plug-in chapter.

Here is a list of build in segment modifiers:

Table 10.1. Build in modifiers

Name Parameters Description
BasicUpstart _start Adds a memory block with a basic upstart program that points to the given start address.