aboutsummaryrefslogtreecommitdiff
path: root/i386-asm.c
diff options
context:
space:
mode:
authorgrischka <grischka>2008-03-25 21:05:48 +0000
committergrischka <grischka>2008-03-25 21:05:48 +0000
commitcd24bd05b4fe44f46b009a7fdcfe0efe5a03cbb2 (patch)
treec2ccb69e39860dc276ca32663d9b871f363cffc2 /i386-asm.c
parent9bcc0b970b899cca2273d17572b078e9c7a75032 (diff)
downloadtinycc-cd24bd05b4fe44f46b009a7fdcfe0efe5a03cbb2.tar.gz
tinycc-cd24bd05b4fe44f46b009a7fdcfe0efe5a03cbb2.tar.bz2
get rid of a warning and fix .bat
Diffstat (limited to 'i386-asm.c')
-rw-r--r--i386-asm.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/i386-asm.c b/i386-asm.c
index 899e9d8..21b28d7 100644
--- a/i386-asm.c
+++ b/i386-asm.c
@@ -424,15 +424,15 @@ static inline void asm_modrm(int reg, Operand *op)
static void asm_opcode(TCCState *s1, int opcode)
{
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;
- Operand ops[MAX_OPERANDS], *pop, seg_prefix;
+ Operand ops[MAX_OPERANDS], *pop;
int op_type[3]; /* decoded op type */
/* get operands */
pop = ops;
nb_ops = 0;
- has_seg_prefix = 0;
+ seg_prefix = 0;
for(;;) {
if (tok == ';' || tok == TOK_LINEFEED)
break;
@@ -441,11 +441,10 @@ static void asm_opcode(TCCState *s1, int opcode)
}
parse_operand(s1, pop);
if (tok == ':') {
- if (pop->type != OP_SEG || has_seg_prefix) {
+ if (pop->type != OP_SEG || seg_prefix) {
error("incorrect prefix");
}
- seg_prefix = *pop;
- has_seg_prefix = 1;
+ seg_prefix = segment_prefixes[pop->reg];
next();
parse_operand(s1, pop);
if (!(pop->type & OP_EA)) {
@@ -565,8 +564,8 @@ static void asm_opcode(TCCState *s1, int opcode)
/* now generates the operation */
if (pa->instr_type & OPC_FWAIT)
g(0x9b);
- if (has_seg_prefix)
- g(segment_prefixes[seg_prefix.reg]);
+ if (seg_prefix)
+ g(seg_prefix);
v = pa->opcode;
if (v == 0x69 || v == 0x69) {