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
466 }466 }
467 break;467 break;
468 case TOK_ASM_string:468 case TOK_ASM_string:
469 case TOK_ASM_ascii:
470 case TOK_ASM_asciz:
469 {471 {
470 const uint8_t *p;472 const uint8_t *p;
471 int i;473 int i, size, t;
472 474
475 t = tok;
473 next();476 next();
474 if (tok != TOK_STR)477 for(;;) {
475 expect("string constant");478 if (tok != TOK_STR)
476 p = tokc.cstr->data;479 expect("string constant");
477 for(i = 0; i < tokc.cstr->size; i++)480 p = tokc.cstr->data;
478 g(p[i]);481 size = tokc.cstr->size;
479 next();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 }
480 }493 }
481 break;494 break;
482 case TOK_ASM_text:495 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