History

added .ascii and .asciz directives

bellard committed 22 years ago

Commit eb794711 parent 59c35631 file · +20 −7Browse files

Unified · Split

tccasm.c+20−7
@@ -466,17 +466,30 @@ static void asm_parse_directive(TCCState *s1) · 465 unmodified lines
466466 }
467467 break;
468468 case TOK_ASM_string:
469+ case TOK_ASM_ascii:
470+ case TOK_ASM_asciz:
469471 {
470472 const uint8_t *p;
471− int i;
473+ int i, size, t;
472474
475+ t = tok;
473476 next();
474− if (tok != TOK_STR)
475− expect("string constant");
476− p = tokc.cstr->data;
477− for(i = 0; i < tokc.cstr->size; i++)
478− g(p[i]);
479− next();
477+ for(;;) {
478+ if (tok != TOK_STR)
479+ expect("string constant");
480+ p = tokc.cstr->data;
481+ size = tokc.cstr->size;
482+ if (t == TOK_ASM_ascii && size > 0)
483+ size--;
484+ for(i = 0; i < size; i++)
485+ g(p[i]);
486+ next();
487+ if (tok == ',') {
488+ next();
489+ } else if (tok != TOK_STR) {
490+ break;
491+ }
492+ }
480493 }
481494 break;
482495 case TOK_ASM_text:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t