From 6f3032742000ecd2af59933237dd0b3b57d396bd Mon Sep 17 00:00:00 2001 From: Igor M Date: Sun, 17 Mar 2024 13:02:07 +0200 Subject: [PATCH] Updated example with hex escape --- examples/example.S | 2 +- src/directive.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/example.S b/examples/example.S index eadb310..1019f01 100644 --- a/examples/example.S +++ b/examples/example.S @@ -14,7 +14,7 @@ start: end: tx hello_string: - .db "Hello,\x20world\n", 0 + .db "Hello, w\x6frld\n", 0 hello_string_end: .db 42, "hi", 43 ; TODO .db 'H', 'e', 'l', 'l', 'o', '\0' diff --git a/src/directive.c b/src/directive.c index 0804981..4cb2c0f 100644 --- a/src/directive.c +++ b/src/directive.c @@ -91,7 +91,7 @@ AsmError assemble_directive(char *input, size_t len, ByteVec *out, Token *tok) { size_t pos = tok->start; char byte0 = input[pos]; char byte1 = input[pos + 1]; - if (byte0 == 'd') { + if (tok->len == 0 && byte0 == 'd') { size_t word_size; switch (byte1) { case 'b':