History

get rid of a warning and fix .bat

grischka committed 18 years ago

Commit cd24bd01 parent 9bcc0b92 files · +8 −9Browse files

Unified · Split

2 files
  1. i386-asm.c +7 −8
  2. win32/build-tcc.bat +1 −1
i386-asm.c+7−8
@@ -424,15 +424,15 @@ static inline void asm_modrm(int reg, Operand *op) · 423 unmodified lines
424424 static void asm_opcode(TCCState *s1, int opcode)
425425 {
426426 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;
428428 int nb_ops, s, ss;
429− Operand ops[MAX_OPERANDS], *pop, seg_prefix;
429+ Operand ops[MAX_OPERANDS], *pop;
430430 int op_type[3]; /* decoded op type */
431431
432432 /* get operands */
433433 pop = ops;
434434 nb_ops = 0;
435− has_seg_prefix = 0;
435+ seg_prefix = 0;
436436 for(;;) {
437437 if (tok == ';' || tok == TOK_LINEFEED)
438438 break;
@@ -441,11 +441,10 @@ static void asm_opcode(TCCState *s1, int opcode) · 2 unmodified lines
441441 }
442442 parse_operand(s1, pop);
443443 if (tok == ':') {
444− if (pop->type != OP_SEG || has_seg_prefix) {
444+ if (pop->type != OP_SEG || seg_prefix) {
445445 error("incorrect prefix");
446446 }
447− seg_prefix = *pop;
448− has_seg_prefix = 1;
447+ seg_prefix = segment_prefixes[pop->reg];
449448 next();
450449 parse_operand(s1, pop);
451450 if (!(pop->type & OP_EA)) {
@@ -565,8 +564,8 @@ static void asm_opcode(TCCState *s1, int opcode) · 113 unmodified lines
565564 /* now generates the operation */
566565 if (pa->instr_type & OPC_FWAIT)
567566 g(0x9b);
568− if (has_seg_prefix)
569− g(segment_prefixes[seg_prefix.reg]);
567+ if (seg_prefix)
568+ g(seg_prefix);
570569
571570 v = pa->opcode;
572571 if (v == 0x69 || v == 0x69) {
win32/build-tcc.bat+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 :
55 @echo>..\config.h #define TCC_VERSION "0.9.24"
66 @echo>>..\config.h #define TCC_TARGET_PE 1
7−@echo>>..\config.h #define CONFIG_TCCDIR NULL
7+@echo>>..\config.h #define CONFIG_TCCDIR "."
88 :
99 gcc -Os -fno-strict-aliasing ../tcc.c -o tcc.exe -s
1010 gcc -Os -fno-strict-aliasing ../tcc.c -D LIBTCC -c -o libtcc.o