| @@ -424,15 +424,15 @@ static inline void asm_modrm(int reg, Operand *op) · 423 unmodified lines |
| 424 | 424 | static void asm_opcode(TCCState *s1, int opcode) |
| 425 | 425 | { |
| 426 | 426 | const ASMInstr *pa; |
| 427 | | − int i, modrm_index, reg, v, op1, is_short_jmp, has_seg_prefix; |
| 427 | + int i, modrm_index, reg, v, op1, is_short_jmp, seg_prefix; |
| 428 | 428 | int nb_ops, s, ss; |
| 429 | | − Operand ops[MAX_OPERANDS], *pop, seg_prefix; |
| 429 | + Operand ops[MAX_OPERANDS], *pop; |
| 430 | 430 | int op_type[3]; /* decoded op type */ |
| 431 | 431 | |
| 432 | 432 | /* get operands */ |
| 433 | 433 | pop = ops; |
| 434 | 434 | nb_ops = 0; |
| 435 | | − has_seg_prefix = 0; |
| 435 | + seg_prefix = 0; |
| 436 | 436 | for(;;) { |
| 437 | 437 | if (tok == ';' || tok == TOK_LINEFEED) |
| 438 | 438 | break; |
| @@ -441,11 +441,10 @@ static void asm_opcode(TCCState *s1, int opcode) · 2 unmodified lines |
| 441 | 441 | } |
| 442 | 442 | parse_operand(s1, pop); |
| 443 | 443 | if (tok == ':') { |
| 444 | | − if (pop->type != OP_SEG || has_seg_prefix) { |
| 444 | + if (pop->type != OP_SEG || seg_prefix) { |
| 445 | 445 | error("incorrect prefix"); |
| 446 | 446 | } |
| 447 | | − seg_prefix = *pop; |
| 448 | | − has_seg_prefix = 1; |
| 447 | + seg_prefix = segment_prefixes[pop->reg]; |
| 449 | 448 | next(); |
| 450 | 449 | parse_operand(s1, pop); |
| 451 | 450 | if (!(pop->type & OP_EA)) { |
| @@ -565,8 +564,8 @@ static void asm_opcode(TCCState *s1, int opcode) · 113 unmodified lines |
| 565 | 564 | /* now generates the operation */ |
| 566 | 565 | if (pa->instr_type & OPC_FWAIT) |
| 567 | 566 | g(0x9b); |
| 568 | | − if (has_seg_prefix) |
| 569 | | − g(segment_prefixes[seg_prefix.reg]); |
| 567 | + if (seg_prefix) |
| 568 | + g(seg_prefix); |
| 570 | 569 | |
| 571 | 570 | v = pa->opcode; |
| 572 | 571 | if (v == 0x69 || v == 0x69) { |