The label variable_foo is an example of a special form to declare the name and location of a variable accessable from C. The special label prefix `` variable_'' is followed the name of the variable, in this case, `` foo.''
This label must be immediately followed by the statement FDB <number>. This is an assembler directive that creates a two-byte value (which is the initial value of the variable).
Variables used by binary programs must be declared in the binary file. These variables then become C globals when the binary file is loaded into C.
The next binary program in the file is named `` set_foo.'' It performs the action of setting the value of the variable foo, which is defined later in the file. It does this by storing the D register into the memory contents reserved for foo, and then returning.
The next binary program is named `` get_foo.'' It loads the D register from the memory reserved for foo and then returns.