From e7a8bb1140a6949b2dce92e613a54e7a40ebf8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ni=C3=B1o=20D=C3=ADaz?= Date: Thu, 7 Dec 2017 22:35:03 +0000 Subject: [PATCH] Fix and document DL keyword MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This keyword acts like DB or DW but for 32-bit values. Signed-off-by: Antonio Niño Díaz --- include/asm/localasm.h | 1 + src/asm/globlex.c | 1 + src/asm/rgbasm.5 | 33 +++++++++++++++++++++------------ 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/include/asm/localasm.h b/include/asm/localasm.h index 92f3eb3a..ff5f3e7c 100644 --- a/include/asm/localasm.h +++ b/include/asm/localasm.h @@ -82,6 +82,7 @@ #define NAME_DB "db" #define NAME_DW "dw" +#define NAME_DL "dl" #define NAME_RB "rb" #define NAME_RW "rw" diff --git a/src/asm/globlex.c b/src/asm/globlex.c index 60703a32..1a523773 100644 --- a/src/asm/globlex.c +++ b/src/asm/globlex.c @@ -305,6 +305,7 @@ struct sLexInitString staticstrings[] = { {"ds", T_POP_DS}, {NAME_DB, T_POP_DB}, {NAME_DW, T_POP_DW}, + {NAME_DL, T_POP_DL}, {"section", T_POP_SECTION}, {"purge", T_POP_PURGE}, diff --git a/src/asm/rgbasm.5 b/src/asm/rgbasm.5 index 047ae5ff..f4051afb 100644 --- a/src/asm/rgbasm.5 +++ b/src/asm/rgbasm.5 @@ -558,30 +558,37 @@ The following symbols are defined by the assembler: .Ss Defining constant data .Ic DB defines a list of bytes that will be stored in the final image. -Ideal for tables and text. +Ideal for tables and text (which is not zero-terminated). .Pp .Dl DB 1,2,3,4,\[dq]This is a string\[dq] .Pp Alternatively, you can use .Ic DW -to store a list of words. +to store a list of words (16-bits) or +.Ic DL +to store a list of doublewords/longs (32-bits). Strings are not allowed as arguments to -.Ic DW . +.Ic DW +and +.Ic DL . .Pp You can also use -.Ic DB -and +.Ic DB , .Ic DW -without arguments. -This works exactly like -.Sy DS 1 and +.Ic DL +without arguments, or leaving empty elements at any point in the list. +This works exactly like +.Sy DS 1 , .Sy DS 2 +and +.Sy DS 4 respectively. Consequently, -.Ic DB -and +.Ic DB , .Ic DW +and +.Ic DL can be used in a .Sy WRAM0 No / Sy WRAMX No / Sy HRAM No / Sy VRAM No / Sy SRAM section. @@ -591,9 +598,10 @@ allocates a number of bytes. The content is undefined. This is the preferred method of allocationg space in a RAM section. You can, however, use -.Ic DB -and +.Ic DB , .Ic DW +and +.Ic DL without any arguments instead. .Pp .Dl DS str_SIZEOF ;allocate str_SIZEOF bytes @@ -1036,6 +1044,7 @@ machine. .It Sx DB .It Sx DEF .It Sx DIV +.It Sx DL .It Sx DS .It Sx DW .It Sx ELIF