Fix and document DL keyword

This keyword acts like DB or DW but for 32-bit values.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2017-12-07 22:35:03 +00:00
parent f1c13af703
commit e7a8bb1140
3 changed files with 23 additions and 12 deletions

View File

@@ -82,6 +82,7 @@
#define NAME_DB "db" #define NAME_DB "db"
#define NAME_DW "dw" #define NAME_DW "dw"
#define NAME_DL "dl"
#define NAME_RB "rb" #define NAME_RB "rb"
#define NAME_RW "rw" #define NAME_RW "rw"

View File

@@ -305,6 +305,7 @@ struct sLexInitString staticstrings[] = {
{"ds", T_POP_DS}, {"ds", T_POP_DS},
{NAME_DB, T_POP_DB}, {NAME_DB, T_POP_DB},
{NAME_DW, T_POP_DW}, {NAME_DW, T_POP_DW},
{NAME_DL, T_POP_DL},
{"section", T_POP_SECTION}, {"section", T_POP_SECTION},
{"purge", T_POP_PURGE}, {"purge", T_POP_PURGE},

View File

@@ -558,30 +558,37 @@ The following symbols are defined by the assembler:
.Ss Defining constant data .Ss Defining constant data
.Ic DB .Ic DB
defines a list of bytes that will be stored in the final image. 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 .Pp
.Dl DB 1,2,3,4,\[dq]This is a string\[dq] .Dl DB 1,2,3,4,\[dq]This is a string\[dq]
.Pp .Pp
Alternatively, you can use Alternatively, you can use
.Ic DW .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 Strings are not allowed as arguments to
.Ic DW . .Ic DW
and
.Ic DL .
.Pp .Pp
You can also use You can also use
.Ic DB .Ic DB ,
and
.Ic DW .Ic DW
without arguments.
This works exactly like
.Sy DS 1
and 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 .Sy DS 2
and
.Sy DS 4
respectively. respectively.
Consequently, Consequently,
.Ic DB .Ic DB ,
and
.Ic DW .Ic DW
and
.Ic DL
can be used in a can be used in a
.Sy WRAM0 No / Sy WRAMX No / Sy HRAM No / Sy VRAM No / Sy SRAM .Sy WRAM0 No / Sy WRAMX No / Sy HRAM No / Sy VRAM No / Sy SRAM
section. section.
@@ -591,9 +598,10 @@ allocates a number of bytes.
The content is undefined. The content is undefined.
This is the preferred method of allocationg space in a RAM section. This is the preferred method of allocationg space in a RAM section.
You can, however, use You can, however, use
.Ic DB .Ic DB ,
and
.Ic DW .Ic DW
and
.Ic DL
without any arguments instead. without any arguments instead.
.Pp .Pp
.Dl DS str_SIZEOF ;allocate str_SIZEOF bytes .Dl DS str_SIZEOF ;allocate str_SIZEOF bytes
@@ -1036,6 +1044,7 @@ machine.
.It Sx DB .It Sx DB
.It Sx DEF .It Sx DEF
.It Sx DIV .It Sx DIV
.It Sx DL
.It Sx DS .It Sx DS
.It Sx DW .It Sx DW
.It Sx ELIF .It Sx ELIF