From 6355d0598b86987a607795e1e083aac2cbc28d10 Mon Sep 17 00:00:00 2001
From: ISSOtm Cycles: 3 Unlike in a lot of languages, and for technical reasons,
! returns 1 if the operand was 0, and 1 otherwise. ! returns 1 if the operand was 0, and 0 otherwise. name is a string enclosed in double quotes,
- and can be a new name or the name of an existing section. All sections
- assembled at the same time that have the same name are considered to be the
- same section, and their code is put together in the object file generated by
- the assembler. If the type doesn't match, an error occurs. All other
- sections must have a unique name, even in different source files, or the
- linker will treat it as an error.
+ld f, [sp] ; See below for individual flags
inc sp
ld a, [sp]
inc sp
-ld f, [sp] ; See below for individual flags
-g chars]
[-i path]
[-M depend_file]
+ [-MG] [-MP]
+ [-MT target_file]
+ [-MQ target_file]
[-o out_file]
[-p pad_value]
[-r recursion_depth]
@@ -107,6 +110,35 @@ The rgbasm program creates an RGB object file from an
depend_file
-MG-M. This makes
+ rgbasm assume that missing files are
+ auto-generated: when INCLUDE or
+ INCBIN is attempted on a non-existent file, it is
+ added as a dependency, then rgbasm exits normally
+ instead of erroring out. This feature is used in automatic updating of
+ makefiles.-MP-MT
+ target_file-M. The exact
+ string provided will be written, including spaces and special characters.
+ -MT
+ -fileA -MT
+ -fileB-MT
+ -'fileA
+ -fileB'.-MQ is specified, the output
+ file name is used.-MQ
+ target_file-MT, but additionally escapes any special
+ make(1) characters, essentially ‘$’.-o
out_file,
--output
@@ -200,10 +232,10 @@ Warnings are diagnostic messages that indicate possibly erroneous behavior that
-Wlong-string-Wall.-Wobsolete-Wno-obsoletejp [hl]
- instruction or HOME section type are encountered.
- This warning is enabled by -Wextra.HOME section type are
+ encountered.
-Wshiftrgbasm still evaluates both operands of
‘&&’ and ‘||’.Fixed‐point
@@ -639,12 +639,9 @@ Before you can start writing code, you must define a section. This tells the
type[addr],
options
Possible section types are as follows:
ROM0ALIGN[align]ALIGN[align,
+ offset]ALIGN[align] is a
+ shorthand for ALIGN[align,
+ 0]). This option can be used with
+ [addr], as long as they don't contradict eachother.
+ It's also possible to request alignment in the middle of a section, see
+ Requesting alignment
+ below.
If [addr] is not specified, the section is considered “floating”; the linker will automatically calculate @@ -724,7 +727,7 @@ Before you can start writing code, you must define a section. This tells the
-SECTION "CoolStuff",ROMX
+SECTION "Cool Stuff",ROMX
-SECTION "CoolStuff",ROMX[$4567]
+SECTION "Cool Stuff",ROMX[$4567]
-SECTION "CoolStuff",ROMX[$4567],BANK[3]
+SECTION "Cool Stuff",ROMX[$4567],BANK[3]
-SECTION "CoolStuff",ROMX,BANK[7]
+SECTION "Cool Stuff",ROMX,BANK[7]
rgbasm invocation, and across
several invocations. Different declarations are treated and merged
identically whether within the same invocation, or different ones.
- -w flag is used,
WRAM0 and WRAMX types are
@@ -865,6 +869,43 @@ When you're tight on RAM, you may want to define overlapping blocks of
Unions. Similarly, the size of an unionized
section is the largest of all its declarations.
+-w flag is used,
+ WRAM0 and WRAMX types are
+ still considered different.When RGBASM merges two fragments, the one encountered later is + appended to the one encountered earlier.
+When RGBLINK merges two fragments, the one whose file was
+ specified last is appended to the one whose file was specified first. For
+ example, assuming ‘bar.o’,
+ ‘baz.o’, and
+ ‘foo.o’ all contain a fragment with
+ the same name, the command
rgblink -o rom.gb baz.o foo.o
+ bar.obaz.o’
+ first, followed by the one from ‘foo.o’,
+ and the one from ‘bar.o’ last.
+.local:’. If the former notation
is used, then ‘scope’ must be the
actual current scope.
+ Local labels may have whitespace before their declaration as + the only exception to the rule.
A label's location (and thus value) is usually not determined until the linking stage, so labels usually cannot be used as constants. However, if the section in which the label is declared has a fixed base @@ -1665,6 +1708,23 @@ DW `00112233 number of entries is limited only by the amount of memory in your machine.
ALIGN as presented in
+ SECTIONS is often useful as-is, sometimes
+ you instead want a particular piece of data (or code) in the middle of the
+ section to be aligned. This is made easier through the use of mid-section
+ align align,
+ offset. It will alter the section's attributes to ensure
+ that the location the align directive is at, has its
+ align lower bits equal to offset.
+If the constraint cannot be met (for example because the section
+ is fixed at an incompatible address), and error is produced. Note that
+ align align is a shorthand for
+ align align,
+ 0.
$23unary!unary !$30rgblink |
- [-dtVvw] [-l
+ | [-dtVvwx] [-l
linker_script] [-m
map_file] [-n
sym_file] [-O
@@ -71,7 +71,7 @@ The rgblink program links RGB object files, typically
-d,
--dmg-w.-l
linker_script,
@@ -122,7 +122,8 @@ The rgblink program links RGB object files, typically
-t,
--tiny-V,
--versionrgblink program links RGB object files, typically
-w,
--wramx-x,
+ --nopad-t. You can use this when not not making a
+ ROM. When making a ROM, be careful that not using this is not a
+ replacement for rgbfix(1)'s -p
+ option! |