ref: 417cceb0de454dd5312176e006cd41af6a6f0f4e
parent: 165bd8cb71c5ebe4f5cf79ed4179f9302834aa07
author: ISSOtm <eldredhabert0@gmail.com>
date: Thu Dec 10 10:53:26 EST 2020
Document dw and dl with strings
--- a/src/asm/rgbasm.5
+++ b/src/asm/rgbasm.5
@@ -1075,11 +1075,27 @@
.Ic DB
defines a list of bytes that will be stored in the final image.
Ideal for tables and text.
-Note that strings are not zero-terminated!
.Bd -literal -offset indent
DB 1,2,3,4,"This is a string"
.Ed
.Pp
+Alternatively, you can use
+.Ic DW
+to store a list of words (16-bit) or
+.Ic DL
+to store a list of double-words/longs (32-bit).
+.Pp
+Strings are handled a little specially: they first undergo charmap conversion (see
+.Sx Character maps ) ,
+then each resulting character is output individually.
+For example, under the default charmap, the following two lines are identical:
+.Bd -literal -offset indent
+DW "Hello!"
+DW "H", "e", "l", "l", "o", "!"
+.Ed
+.Pp
+If you do not want this special handling, enclose the string in parentheses.
+.Pp
.Ic DS
can also be used to fill a region of memory with some value.
The following produces 42 times the byte $FF:
@@ -1086,16 +1102,6 @@
.Bd -literal -offset indent
DS 42, $FF
.Ed
-.Pp
-Alternatively, you can use
-.Ic DW
-to store a list of words (16-bit) or
-.Ic DL
-to store a list of double-words/longs (32-bit).
-Strings are not allowed as arguments to
-.Ic DW
-and
-.Ic DL .
.Pp
You can also use
.Ic DB , DW