Include a file: Difference between revisions

Content added Content deleted
m (→‎{{header|6502 Assembly}}: added more examples and demonstrated the difference between include and incbin)
Line 42: Line 42:
</pre>
</pre>


As you can see, when <code>incbin</code> was used the assembler made no attempt to translate the assembly mnemonic into machine instructions.
As you can see, when <code>incbin</code> was used the assembler made no attempt to translate the assembly mnemonic into machine instructions. While anything that <code>incbin</code> can do, <code>include</code> can do also, using data blocks, it is often much easier to use <code>incbin</code> if you have a separate graphics creation program that can output graphics data into a raw binary form. Graphics data often contains hundreds of redundant bytes which can be very painful and time-consuming to type by hand.


Unlike high-level languages, the location of the <code>include</code> or <code>incbin</code> statement matters. This of course depends on the assembler, but generally speaking, there are a few limitations:
Unlike high-level languages, the location of the <code>include</code> or <code>incbin</code> statement matters. This of course depends on the assembler, but generally speaking, there are a few limitations: