get rid of a warning and fix .bat

This commit is contained in:
grischka 2008-03-25 21:05:48 +00:00
parent 9bcc0b970b
commit cd24bd05b4
2 changed files with 8 additions and 9 deletions

View file

@ -424,15 +424,15 @@ static inline void asm_modrm(int reg, Operand *op)
static void asm_opcode(TCCState *s1, int opcode) static void asm_opcode(TCCState *s1, int opcode)
{ {
const ASMInstr *pa; const ASMInstr *pa;
int i, modrm_index, reg, v, op1, is_short_jmp, has_seg_prefix; int i, modrm_index, reg, v, op1, is_short_jmp, seg_prefix;
int nb_ops, s, ss; int nb_ops, s, ss;
Operand ops[MAX_OPERANDS], *pop, seg_prefix; Operand ops[MAX_OPERANDS], *pop;
int op_type[3]; /* decoded op type */ int op_type[3]; /* decoded op type */
/* get operands */ /* get operands */
pop = ops; pop = ops;
nb_ops = 0; nb_ops = 0;
has_seg_prefix = 0; seg_prefix = 0;
for(;;) { for(;;) {
if (tok == ';' || tok == TOK_LINEFEED) if (tok == ';' || tok == TOK_LINEFEED)
break; break;
@ -441,11 +441,10 @@ static void asm_opcode(TCCState *s1, int opcode)
} }
parse_operand(s1, pop); parse_operand(s1, pop);
if (tok == ':') { if (tok == ':') {
if (pop->type != OP_SEG || has_seg_prefix) { if (pop->type != OP_SEG || seg_prefix) {
error("incorrect prefix"); error("incorrect prefix");
} }
seg_prefix = *pop; seg_prefix = segment_prefixes[pop->reg];
has_seg_prefix = 1;
next(); next();
parse_operand(s1, pop); parse_operand(s1, pop);
if (!(pop->type & OP_EA)) { if (!(pop->type & OP_EA)) {
@ -565,8 +564,8 @@ static void asm_opcode(TCCState *s1, int opcode)
/* now generates the operation */ /* now generates the operation */
if (pa->instr_type & OPC_FWAIT) if (pa->instr_type & OPC_FWAIT)
g(0x9b); g(0x9b);
if (has_seg_prefix) if (seg_prefix)
g(segment_prefixes[seg_prefix.reg]); g(seg_prefix);
v = pa->opcode; v = pa->opcode;
if (v == 0x69 || v == 0x69) { if (v == 0x69 || v == 0x69) {

View file

@ -4,7 +4,7 @@
: :
@echo>..\config.h #define TCC_VERSION "0.9.24" @echo>..\config.h #define TCC_VERSION "0.9.24"
@echo>>..\config.h #define TCC_TARGET_PE 1 @echo>>..\config.h #define TCC_TARGET_PE 1
@echo>>..\config.h #define CONFIG_TCCDIR NULL @echo>>..\config.h #define CONFIG_TCCDIR "."
: :
gcc -Os -fno-strict-aliasing ../tcc.c -o tcc.exe -s gcc -Os -fno-strict-aliasing ../tcc.c -o tcc.exe -s
gcc -Os -fno-strict-aliasing ../tcc.c -D LIBTCC -c -o libtcc.o gcc -Os -fno-strict-aliasing ../tcc.c -D LIBTCC -c -o libtcc.o