Table of Contents
bin “object format” does not produce object files: the output file
produced contains only the section data; no headers or relocations are generated. The
output can be considered “plain
binary”, and is useful for operating system and boot loader development,
.COM executables and
.SYS device drivers,
and creating images for embedded target environments (e.g. Flash ROM).
bin object format supports an unlimited number of
named sections. See Section 7.2 for details. The only
restriction on these sections is that their storage locations in the output file cannot
When used with the x86 architecture, the
format starts Yasm in 16-bit mode. In order to write native 32-bit or 64-bit code, an
BITS 32 or
directive is required respectively.
bin produces an output file with no extension by default;
it simply strips the extension from the input file name. Thus the default output filename
for the input file
foo.asm is simply
bin provides the
ORG directive in NASM syntax to allow setting of the memory address at
which the output file is initially loaded. The
may only be used once (as the output file can only be initially loaded into a single
ORG is not specified,
ORG 0 is used by default.
This makes the operation of NASM-syntax
different from the operation of
ORG in other assemblers,
which typically simply move the assembly location to the value given.
bin provides a more powerful alternative in the form of extensions to
SECTION directive; see Section 7.2 for details.
When combined with multiple sections,
ORG also has the
effect of defaulting the LMA of the first section to the
value to make the output file as small as possible. If this is not the desired behavior,
explicitly specify a LMA for all sections via either
FOLLOWS qualifiers in the