From b50ab7a9ad86b638ac501544497c3283364ab2e7 Mon Sep 17 00:00:00 2001 From: simon987 Date: Thu, 30 Jul 2020 18:46:24 -0400 Subject: [PATCH] Document string literals --- Assembler-directives.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/Assembler-directives.md b/Assembler-directives.md index 1f04955..8ba3993 100644 --- a/Assembler-directives.md +++ b/Assembler-directives.md @@ -92,6 +92,27 @@ mynumber: DW 0x0000 ;; use [] to reference the contents of the memory ``` + +### String literals + +```asm +my_str: DW "Hello" + +.text +MOV A, [my_str] ; Value of A is now 'H' +``` + + +### Character literals +// NOT IMPLEMENTED + + +You can combine any type of literal values in a single line, for example: + +```asm +DW "some string", 123, "another string", 0 +``` + ## DUP The `DUP` directive (Duplicate) is used as operand for the `DW` directive. The syntax: ```s @@ -104,11 +125,6 @@ It can only be used in combination with the `DW` directive ## Sections // TODO -## Strings -// TODO - -## Characters -// NOT IMPLEMENTED ## ORG