shithub: rgbds

ref: e771d60ec0b5db03822b8a64ca1f6c92e222fcd1
dir: /docs/rgblink.5.html/

View raw version
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8"/>
  <style>
    table.head, table.foot { width: 100%; }
    td.head-rtitle, td.foot-os { text-align: right; }
    td.head-vol { text-align: center; }
    div.Pp { margin: 1ex 0ex; }
  </style>
  <link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
  <title>RGBLINK(5)</title>
</head>
<body>
<table class="head">
  <tr>
    <td class="head-ltitle">RGBLINK(5)</td>
    <td class="head-vol">File Formats Manual</td>
    <td class="head-rtitle">RGBLINK(5)</td>
  </tr>
</table>
<div class="manual-text">
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
<b class="Nm" title="Nm">rgblink</b> &#x2014;
  <span class="Nd" title="Nd">linkerscript file format</span>
<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="selflink" href="#DESCRIPTION">DESCRIPTION</a></h1>
The linkerscript is an external file that allows the user to specify the order
  of sections without the need for doing so before assembling each object file.
<div class="Pp"></div>
The placement of sections specified in the linkerscript is done before the
  sections whose placement is defined in the source code.
<div class="Pp"></div>
A linkerscript consists on a series of banks followed by a list of sections and,
  optionally, commands. They can be lowercase or uppercase, it is ignored. Any
  line can contain a comment starting with
  &#x2018;<code class="Li">;</code>&#x2019; that ends at the end of the line:
<div class="Pp"></div>
<div class="Bd" style="margin-left: 5.00ex;">
<pre class="Li">
ROMX $F ; This is a comment 
  &quot;Functions to read array&quot; 
  ALIGN 8 
  &quot;Array aligned to 256 bytes&quot; 
 
WRAMX 2 
  &quot;Some variables&quot;
</pre>
</div>
<div class="Pp"></div>
Numbers can be in decimal or hexadecimal format (the prefix is
  &#x2018;<code class="Li">$</code>&#x2019;). It is an error if any section name
  or command are found before setting a bank.
<div class="Pp"></div>
Files can be included by using the <var class="Ar" title="Ar">INCLUDE</var>
  keyword followed by a string with the path of the file that has to be
  included.
<div class="Pp"></div>
The possible bank types are: <b class="Sy" title="Sy">ROM0</b>,
  <b class="Sy" title="Sy">ROMX</b>, <b class="Sy" title="Sy">VRAM</b>,
  <b class="Sy" title="Sy">WRAM0</b>, <b class="Sy" title="Sy">WRAMX</b>,
  <b class="Sy" title="Sy">OAM</b> and <b class="Sy" title="Sy">HRAM</b>. Types
  <b class="Sy" title="Sy">ROMX</b>, <b class="Sy" title="Sy">VRAM</b>,
  <b class="Sy" title="Sy">WRAMX</b> and <b class="Sy" title="Sy">SRAM</b> are
  banked, which means that it is needed to specify a bank after the type.
<div class="Pp"></div>
When a new bank statement is found, sections found after it will be placed right
  from the beginning of that bank. If the linkerscript switches to a different
  bank and then it comes back to the previous one it will continue from the last
  address that was used.
<div class="Pp"></div>
The only two commands are <var class="Ar" title="Ar">ORG</var> and
  <var class="Ar" title="Ar">ALIGN</var>:
<ul class="Bl-bullet">
  <li class="It-bullet"><var class="Ar" title="Ar">ORG</var> sets the address in
      which new sections will be placed. It can not be lower than the current
      address.</li>
  <li class="It-bullet"><var class="Ar" title="Ar">ALIGN</var> will increase the
      address until it is aligned to the specified boundary (it tries to set to
      0 the number of bits specified after the command:
      <b class="Sy" title="Sy">ALIGN 8</b> will align to $100).</li>
</ul>
<div class="Pp"></div>
Note: The bank, alignment, address and type of sections can be specified both in
  the source code and in the linkerscript. For a section to be able to be placed
  with the linkerscript the bank must be left unassigned in the source code or
  be the same as the one specified in the linkerscript. The address and
  alignment musn't be set.
<h1 class="Sh" title="Sh" id="SEE_ALSO"><a class="selflink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<a class="Xr" title="Xr">rgbasm(1)</a>, <a class="Xr" title="Xr">rgblink(1)</a>,
  <a class="Xr" title="Xr">rgbfix(1)</a>, <a class="Xr" title="Xr">rgbds(5)</a>,
  <a class="Xr" title="Xr">rgbds(7)</a>
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
<b class="Nm" title="Nm">rgblink</b> was originally written by Carsten
  S&#x00F8;rensen as part of the ASMotor package, and was later packaged in
  RGBDS by Justin Lloyd. It is now maintained by a number of contributors at
  <a class="Lk" title="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.</div>
<table class="foot">
  <tr>
    <td class="foot-date">January 27, 2018</td>
    <td class="foot-os">RGBDS Manual</td>
  </tr>
</table>
</body>
</html>