Keil Logo


12.47 INCBIN

The INCBIN directive includes a file within the file being assembled. The file is included as it is, without being assembled.


INCBIN filename
is the name of the file to be included in the assembly. The assembler accepts pathnames in either UNIX or MS-DOS format.


You can use INCBIN to include executable files, literals, or any arbitrary data. The contents of the file are added to the current ELF section, byte for byte, without being interpreted in any way. Assembly continues at the line following the INCBIN directive.
By default, the assembler searches the current place for included files. The current place is the directory where the calling file is located. Use the -i assembler command-line option to add directories to the search path. File names and directory names containing spaces must not be enclosed in double quotes ( " " ).


     AREA    Example, CODE, READONLY
     INCBIN  file1.dat              ; Includes file1 if it exists in the current place
     INCBIN  c:\project\file2.txt   ; Includes file2.
Non-ConfidentialPDF file icon PDF versionARM DUI0379H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 

Related Knowledgebase Articles

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.