From 07bba2229a07d17f6d41ccf83c425af9abc65450 Mon Sep 17 00:00:00 2001 From: simon987 Date: Thu, 30 Jul 2020 19:03:26 -0400 Subject: [PATCH] More info on string literals --- Assembler-directives.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Assembler-directives.md b/Assembler-directives.md index 8ba3993..d94af00 100644 --- a/Assembler-directives.md +++ b/Assembler-directives.md @@ -95,16 +95,19 @@ mynumber: DW 0x0000 ### String literals +You can use the `DW` to store strings, for example: + ```asm my_str: DW "Hello" +; This is assembled to: +; 00 48 00 65 00 6C 00 6C 00 6F + .text MOV A, [my_str] ; Value of A is now 'H' ``` - -### Character literals -// NOT IMPLEMENTED +Java escape sequences are handled (`\u0000`, `\"`. `\0` `\t` etc) and strings are encoded to 16-bit big endian. You can combine any type of literal values in a single line, for example: