diff options
-rw-r--r-- | assemble.c | 31 |
1 files changed, 4 insertions, 27 deletions
@@ -274,33 +274,10 @@ uint64_t handle_directive(token *t, bytecount *bc, uint8_t isasm, uint64_t addre break; case TOK_STRING: if (type == DIR_BYTE) { - for (uint16_t k = 0; t->str[k] != '\0'; k++) { - switch (t->str[k]) { - case '\\': - switch (t->str[k+1]) { - case 'n' : c = '\n'; break; - case 'r' : c = '\r'; break; - case 't' : c = '\t'; break; - case '\"': c = '\"'; break; - case '\'': c = '\''; break; - case '\\': c = '\\'; break; - case '0' : c = '\0'; break; - } - k++; - break; - default: c = t->str[k]; break; - } - if (isasm) { - addr[tmpaddr] = c; - } - tmpaddr++; - bc->datasize++; - } - if (isasm) { - addr[tmpaddr] = '\0'; - } - tmpaddr++; - bc->datasize++; + char *s = t->str; + tmp = parse_quote(&s, '\0', isasm, &addr[tmpaddr], dbg); + tmpaddr += tmp; + bc->datasize += tmp; } break; } |