diff options
Diffstat (limited to 'lexer.c')
-rw-r--r-- | lexer.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -270,7 +270,7 @@ uint64_t lex(char *str, uint64_t address, uint8_t dbg) { for (; isdelm(str[i], dbg) == 16; i++); } uint8_t ptok = get_ptok(str[i], dbg); - if (ptok == PTOK_X || ptok == PTOK_Y || ptok == PTOK_S || ptok == PTOK_P) { + if (is_altok(ptok, dbg)) { offset++; if ((ptok == PTOK_S && toupper(str[i+1]) == 'P') || (ptok == PTOK_P && toupper(str[i+1]) == 'C')) { offset++; @@ -278,6 +278,7 @@ uint64_t lex(char *str, uint64_t address, uint8_t dbg) { } switch (get_ptok(str[i+offset], dbg)) { + case PTOK_B : case PTOK_X : case PTOK_Y : case PTOK_S : @@ -455,6 +456,13 @@ uint64_t lex(char *str, uint64_t address, uint8_t dbg) { lexeme[j+1] = '\0'; lexeme[j+2] = '\0'; break; + case PTOK_B: + lexeme[j] = str[i++]; + lexeme[j+1] = '\0'; + lexeme[j+2] = '\0'; + lex_type = TOK_BREG; + l->tok->type = BREG; + break; case PTOK_X: case PTOK_Y: lexeme[j] = str[i++]; |