From a1d132cd35b8763aaf202b3e01441da12a96f762 Mon Sep 17 00:00:00 2001
From: ISSOtm Pipes way: The resulting object file is not yet a usable ROM image —
it must first be run through rgblink(1) and
rgbfix(1). Note that a colon (:) following the label-name is not allowed.
String equates can't be exported or imported. Important note: An EQUS can be expanded to a
- string that contains another EQUS and it will be expanded as well. This
- means that, if you aren't careful, you may trap the assembler into an
- infinite loop if there's a circular dependency in the expansions. Also,
- a MACRO can have inside an EQUS which references the same MACRO, which
- has the same problem.-M dependfile]
[-o outfile]
[-p pad_value]
+ [-r recursion_depth]
file
@@ -46,7 +47,9 @@
DESCRIPTION
The rgbasm program creates an object file from an
- assembly source file. Its arguments are as follows:
+ assembly source file. The input file can be a file path,
+ or - denoting stdin. Its
+ arguments are as follows:
-b
charsrgbasm program creates an object file from an
-p
pad_value-r
+ recursion_depth-V-vrgbasm program creates an object file from an
EXAMPLES
-Assembling a basic source file is simple:
+You can assemble a source file in two ways. Straight forward way:
$ rgbasm -o bar.o foo.asm
+$ cat foo.asm | rgbasm -o bar.o -
+$ rgbasm -o bar.o - < foo.asm
+
+
diff --git a/docs/rgbasm.5.html b/docs/rgbasm.5.html
index f974342e..1ecd3bf1 100644
--- a/docs/rgbasm.5.html
+++ b/docs/rgbasm.5.html
@@ -2,9 +2,9 @@
@@ -426,11 +426,11 @@ PUSHA EQUS "push af\npush bc\npush de\npush hl\n"
-
February 24, 2018
+ July 8, 2019
RGBDS Manual
SHIFT.
Line continuations work as usual inside macros or lists of - arguments of macros. Strings, however, are a bit trickier. The following - example shows how to use strings as arguments for a macro:
+ arguments of macros. However, some characters need to be escaped, as in + the following example:
PrintMacro : MACRO
PRINTT \1
ENDM
- PrintMacro STRCAT(\"Hello\"\, \
- \" world\\n\")
+ PrintMacro STRCAT("Hello"\, \
+ " world\\n")
SHIFT is a special command only
@@ -1189,55 +1189,88 @@ The most basic string expression is any number of characters contained in double
This will examine the type of the symbol and insert its value accordingly.
If symbol is a string symbol, the symbols value is simply copied. If it's a
numeric symbol, the value is converted to hexadecimal notation and inserted
- as a string.
HINT: The {symbol} construct can also be used - outside strings. The symbol's value is again inserted as a string. This is - just a short way of doing “{symbol}”.
-Whenever the macro-language expects a string you can actually use - a string expression. This consists of one or more of these function (yes, - you can nest them). Note that some of these functions actually return an - integer and can be used as part of an integer expression!
-| Name | -Operation | +Print type | +Format | +Example | ||||||||||||||||
STRLEN(string) |
- Returns the number of characters in string | +d |
+ Decimal | +42 | ||||||||||||||||
STRCAT(str1,
- str2) |
- Appends str2 to str1. | +x |
+ Lowercase hexadecimal | +2a | ||||||||||||||||
STRCMP(str1,
- str2) |
- Returns negative if str1 is alphabetically lower than str2, zero if they - match, positive if str1 is greater than str2. | +X |
+ Uppercase hexadecimal | +2A | ||||||||||||||||
STRIN(str1,
- str2) |
- Returns the position of str2 in str1 or zero if it's not present (first - character is position 1). | -|||||||||||||||||||
STRSUB(str,
- pos, len) |
- Returns a substring from str starting at pos (first character is - position 1) and with len characters. | -|||||||||||||||||||
STRUPR(str) |
- Converts all characters in str to capitals and returns the new - string. | -|||||||||||||||||||
STRLWR(str) |
- Converts all characters in str to lower case and returns the new - string. | +b |
+ Binary | +101010
+ Note that print types should only be used with numeric values, + not strings. +HINT: The {symbol} construct can also be + used outside strings. The symbol's value is again inserted as a string. + This is just a short way of doing “{symbol}”. +Whenever the macro-language expects a string you can actually + use a string expression. This consists of one or more of these function + (yes, you can nest them). Note that some of these functions actually + return an integer and can be used as part of an integer expression! +
|
It is possible to create multiple character maps and then switch + between them as desired. This can be used to encode debug information in + ASCII and use a different encoding for other purposes, for example. + Initially, there is one character map called main and it + is automatically selected as the current character map from the beginning. + There is also a character map stack that can be used to save and restore + which character map is currently active.
+| Command | +Meaning | +
NEWCHARMAP
+ name |
+ Creates a new, empty character map called
+ name. |
+
NEWCHARMAP
+ name, basename |
+ Creates a new character map called name, copied
+ from character map basename. |
+
SETCHARMAP
+ name |
+ Switch to character map name. |
+
PUSHC |
+ Push the current character map onto the stack. | +
POPC |
+ Pop a character map off the stack and switch to it. | +
Note: Character maps affect all strings in the - file from the point in which they are defined. This means that any string - that the code may want to print as debug information will also be affected - by it.
+ file from the point in which they are defined, until switching to a + different character map. This means that any string that the code may want + to print as debug information will also be affected by it.Note: The output value of a mapping can be 0. If this happens, the assembler will treat this as the end of the string and the rest of it will be trimmed.
diff --git a/docs/rgbds.5.html b/docs/rgbds.5.html index f3f4c737..fc0e5156 100644 --- a/docs/rgbds.5.html +++ b/docs/rgbds.5.html @@ -2,9 +2,9 @@ diff --git a/docs/rgbds.7.html b/docs/rgbds.7.html index aa51b345..2f0ed658 100644 --- a/docs/rgbds.7.html +++ b/docs/rgbds.7.html @@ -2,9 +2,9 @@ diff --git a/docs/rgbfix.1.html b/docs/rgbfix.1.html index 36739fdc..4d4dbfee 100644 --- a/docs/rgbfix.1.html +++ b/docs/rgbfix.1.html @@ -2,9 +2,9 @@ diff --git a/docs/rgbgfx.1.html b/docs/rgbgfx.1.html index 47845101..088167af 100644 --- a/docs/rgbgfx.1.html +++ b/docs/rgbgfx.1.html @@ -2,9 +2,9 @@ @@ -77,6 +77,8 @@ Thergbgfx program converts PNG images into the Nintendo
-a, but the attrmap file output name is
made by taking the input filename, removing the file extension, and
appending .attrmap.-C-D-f