Writing Data Directly to Memory

To write data directly to memory, use appropriate WRITEx keywords in your LCF:

The system inserts the data at the section's current address. The following listing shows an example.

Listing: Embedding Data Directly into Output

.example_data_section :
{

   WRITEB 0x48;  /*  'H'  */

   WRITEB 0x69;  /*  'i'  */

   WRITEB 0x21;  /*  '!'  */

To insert a complete binary file, use the INCLUDE keyword, as the following shows.

Listing: Embedding a Binary File into Output

    _musicStart = .;
    INCLUDE music.mid

    _musicEnd = .;

}  > DATA