]> granicus.if.org Git - yasm/commitdiff
Fix explicitly-overridden short-only instructions such as "loop short label".
authorPeter Johnson <peter@tortall.net>
Thu, 11 Oct 2007 06:05:41 +0000 (06:05 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 11 Oct 2007 06:05:41 +0000 (06:05 -0000)
These would incorrectly be treated as errors.

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

modules/arch/x86/tests/genopcode.asm
modules/arch/x86/tests/genopcode.hex
modules/arch/x86/x86id.c

index f37695d39b793cc5a6da93d196d8575a155f5725..357c010eaad1a6eb2a552cabbdca65c6d94150e3 100644 (file)
@@ -168,6 +168,9 @@ jmp near label
 jmp far [label]
 jmp far dword [label]
 call far word [label]
+loop short label
+jcxz short label
+jecxz short label
 [bits 16]
 push si
 push esi
index d6a562d24bf8fb9d65619f6bb64d4e12b274e137..37b3cf94ff756e152f0fb139f76326ee33efd3cf 100644 (file)
@@ -482,6 +482,13 @@ ff
 1e 
 b9 
 01 
+e2 
+d3 
+e3 
+d1 
+67 
+e3 
+ce 
 56 
 66 
 56 
index 7312913e705a3cb53a1933e72cc2f9c4d01a0fc8..0687ef156b41c7055f05d6dc07e948c5631dce44 100644 (file)
@@ -515,10 +515,10 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc,
         }
     }
 
-    if ((jmp->op_sel == JMP_SHORT_FORCED) && (jmp->nearop.len == 0))
+    if ((jmp->op_sel == JMP_SHORT_FORCED) && (jmp->shortop.len == 0))
         yasm_error_set(YASM_ERROR_TYPE,
                        N_("no SHORT form of that jump instruction exists"));
-    if ((jmp->op_sel == JMP_NEAR_FORCED) && (jmp->shortop.len == 0))
+    if ((jmp->op_sel == JMP_NEAR_FORCED) && (jmp->nearop.len == 0))
         yasm_error_set(YASM_ERROR_TYPE,
                        N_("no NEAR form of that jump instruction exists"));