From 460832c13c9d476d71e626a0c42de4eeff3feb63 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Thu, 11 Jun 2020 21:39:59 -0400 Subject: Did some more stuff. - Fix some bugs with strings. - Started to refactor the instruction functions. - Added support for using RS prefixes on the memory based increment, and decrement instructions. - Started work on SuBAsm's lexer. Have fun looking at this, BieHDC. :) --- lexer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lexer.c') diff --git a/lexer.c b/lexer.c index 47109ca..df478b0 100644 --- a/lexer.c +++ b/lexer.c @@ -301,7 +301,9 @@ uint64_t lex(char *str, uint64_t address, uint8_t dbg) { break; case PTOK_DQUOTE: i++; - for (; isdelm(str[i+j], dbg) != 4; j++); + for (; isdelm(str[i+j], dbg) != 4 || isesc; j++) { + isesc = (str[i+j] == '\\' && str[i+(j-1)] != '\\'); + } memcpy(lexeme, str+i, j); lexeme[j] = '\0'; i += j; @@ -317,7 +319,7 @@ uint64_t lex(char *str, uint64_t address, uint8_t dbg) { printf("lex(): str[0x%04X]: %s\n", strid, string[strid]); } if (lt->id == TOK_DIR && lt->type == DIR_INCLUDE) { - incl[inc_count] = strid; + incl[inc_count+inc_file] = strid; inc_file++; } lex_type = TOK_STRING; -- cgit v1.2.3-13-gbd6f