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 listing shows.

Listing: Embedding a Binary File into Output

    _musicStart = .;

    INCLUDE music.bin

    _musicEnd = .;

}  > DATA
mwldarm . . . . . main.o c:\music.bin commandfile.lcf