]> granicus.if.org Git - yasm/commitdiff
Fix #53. This makes things like "es stosb" work.
authorPeter Johnson <peter@tortall.net>
Thu, 30 Jun 2005 03:57:56 +0000 (03:57 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 30 Jun 2005 03:57:56 +0000 (03:57 -0000)
Reported by: Dmitry Gokun <jedi@online.kharkov.ua>

svn path=/trunk/yasm/; revision=1212

modules/arch/x86/tests/Makefile.inc
modules/arch/x86/tests/stringseg.asm [new file with mode: 0644]
modules/arch/x86/tests/stringseg.errwarn [new file with mode: 0644]
modules/arch/x86/tests/stringseg.hex [new file with mode: 0644]
modules/arch/x86/x86id.re

index 46bb4330791052fbb363c83f9b1b589572d8f13d..794d20b11e00ac28f911f0973834de578740569a 100644 (file)
@@ -136,6 +136,9 @@ EXTRA_DIST += modules/arch/x86/tests/sse3.hex
 EXTRA_DIST += modules/arch/x86/tests/stos.asm
 EXTRA_DIST += modules/arch/x86/tests/stos.errwarn
 EXTRA_DIST += modules/arch/x86/tests/stos.hex
+EXTRA_DIST += modules/arch/x86/tests/stringseg.asm
+EXTRA_DIST += modules/arch/x86/tests/stringseg.errwarn
+EXTRA_DIST += modules/arch/x86/tests/stringseg.hex
 EXTRA_DIST += modules/arch/x86/tests/twobytemem.asm
 EXTRA_DIST += modules/arch/x86/tests/twobytemem.errwarn
 EXTRA_DIST += modules/arch/x86/tests/twobytemem.hex
diff --git a/modules/arch/x86/tests/stringseg.asm b/modules/arch/x86/tests/stringseg.asm
new file mode 100644 (file)
index 0000000..2d15f08
--- /dev/null
@@ -0,0 +1,5 @@
+es stosb
+es stosw
+fs stosd
+gs movsb
+es fs gs movsw
diff --git a/modules/arch/x86/tests/stringseg.errwarn b/modules/arch/x86/tests/stringseg.errwarn
new file mode 100644 (file)
index 0000000..53f9d69
--- /dev/null
@@ -0,0 +1 @@
+-:5: warning: multiple segment overrides, using leftmost
diff --git a/modules/arch/x86/tests/stringseg.hex b/modules/arch/x86/tests/stringseg.hex
new file mode 100644 (file)
index 0000000..cf98246
--- /dev/null
@@ -0,0 +1,11 @@
+26 
+aa 
+26 
+ab 
+64 
+66 
+ab 
+65 
+a4 
+26 
+a5 
index 0bd790d29ba024a03d848b1ac1853244bb369e35..e7620a612d6958bcee10d3823ad93869f5bf75ea 100644 (file)
@@ -2450,6 +2450,11 @@ yasm_x86__finalize_insn(yasm_arch *arch, yasm_bytecode *bc,
        yasm_x86__ea_init(insn->ea, spare, origin);
        for (i=0; i<num_segregs; i++)
            yasm_ea_set_segreg(insn->ea, segregs[i], bc->line);
+    } else if (num_segregs > 0 && insn->special_prefix == 0) {
+       if (num_segregs > 1)
+           yasm__warning(YASM_WARN_GENERAL, bc->line,
+                         N_("multiple segment overrides, using leftmost"));
+       insn->special_prefix = segregs[num_segregs-1]>>8;
     }
     if (imm) {
        insn->imm = yasm_imm_create_expr(imm);