History

tccasm: accept bracketed offset expressions

Joe Soroka committed 15 years ago

Commit 0d9376d1 parent 47b4cf22 files · +15 −2Browse files

Unified · Split

2 files
  1. i386-asm.c +14 −2
  2. tests/asmtest.S +1 −0
i386-asm.c+14−2
@@ -376,8 +376,20 @@ static void parse_operand(TCCState *s1, Operand *op) · 375 unmodified lines
376 op->e.v = e.v;376 op->e.v = e.v;
377 op->e.sym = e.sym;377 op->e.sym = e.sym;
378 } else {378 } else {
379 op->e.v = 0;379 next();
380 op->e.sym = NULL;380 if (tok == '%') {
381 unget_tok('(');
382 op->e.v = 0;
383 op->e.sym = NULL;
384 } else {
385 /* bracketed offset expression */
386 asm_expr(s1, &e);
387 if (tok != ')')
388 expect(")");
389 next();
390 op->e.v = e.v;
391 op->e.sym = e.sym;
392 }
381 }393 }
382 if (tok == '(') {394 if (tok == '(') {
383 next();395 next();
tests/asmtest.S+1−0
@@ -122,6 +122,7 @@ addl $0x123, 0x100 · 121 unmodified lines
122addl $0x123, 0x100(%ebx)122addl $0x123, 0x100(%ebx)
123addl $0x123, 0x100(%ebx,%edx,2)123addl $0x123, 0x100(%ebx,%edx,2)
124addl $0x123, 0x100(%esp)124addl $0x123, 0x100(%esp)
125addl $0x123, (3*8)(%esp)
125addl $0x123, (%ebp)126addl $0x123, (%ebp)
126addl $0x123, (%esp)127addl $0x123, (%esp)
127cmpl $0x123, (%esp)128cmpl $0x123, (%esp)

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