diff --git a/.gitattributes b/.gitattributes index 02b0afd5ff..2890215e36 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8577,6 +8577,7 @@ tests/webtbs/tw11619.pp svneol=native#text/plain tests/webtbs/tw11711.pp svneol=native#text/plain tests/webtbs/tw11762.pp svneol=native#text/plain tests/webtbs/tw11763.pp svneol=native#text/plain +tests/webtbs/tw11786.pp svneol=native#text/plain tests/webtbs/tw1181.pp svneol=native#text/plain tests/webtbs/tw11846a.pp svneol=native#text/plain tests/webtbs/tw11846b.pp svneol=native#text/plain diff --git a/compiler/i386/i386nop.inc b/compiler/i386/i386nop.inc index 73abfe3e57..5fe2125afc 100644 --- a/compiler/i386/i386nop.inc +++ b/compiler/i386/i386nop.inc @@ -1,2 +1,2 @@ { don't edit, this file is generated from x86ins.dat } -1379; +1380; diff --git a/compiler/i386/i386tab.inc b/compiler/i386/i386tab.inc index 35304a868d..26c5edced0 100644 --- a/compiler/i386/i386tab.inc +++ b/compiler/i386/i386tab.inc @@ -2936,10 +2936,17 @@ ( opcode : A_MOV; ops : 2; - optypes : (ot_reg_ax or ot_bits32,ot_mem_offs,ot_none); - code : #213#193#1#161#29; + optypes : (ot_reg_ax,ot_mem_offs,ot_none); + code : #212#193#1#161#29; flags : if_8086 or if_sm or if_nox86_64 ), + ( + opcode : A_MOV; + ops : 2; + optypes : (ot_reg_eax,ot_mem_offs,ot_none); + code : #213#193#1#161#29; + flags : if_386 or if_sm or if_nox86_64 + ), ( opcode : A_MOV; ops : 2; @@ -6346,7 +6353,7 @@ opcode : A_TEST; ops : 2; optypes : (ot_regmem or ot_bits8,ot_reg8,ot_none); - code : #193#211#1#132#72; + code : #193#211#1#132#65; flags : if_8086 or if_sm ), ( diff --git a/compiler/x86/x86ins.dat b/compiler/x86/x86ins.dat index f7c1ce158b..4c951a4c85 100644 --- a/compiler/x86/x86ins.dat +++ b/compiler/x86/x86ins.dat @@ -1017,7 +1017,8 @@ reg_eax,reg_ecx,reg_edx \3\x0F\x01\xC8 PRESCOTT,ND (Ch_Wop2, Ch_Rop1, Ch_None) mem_offs,reg_ax|32 \300\320\1\xA3\34 8086,SM,NOX86_64 regmem,reg16|32|64 \300\320\1\x89\101 8086,SM -reg_ax|32,mem_offs \325\301\1\xA1\35 8086,SM,NOX86_64 +reg_ax,mem_offs \324\301\1\xA1\35 8086,SM,NOX86_64 +reg_eax,mem_offs \325\301\1\xA1\35 386,SM,NOX86_64 reg16|32|64,regmem \301\320\1\x8B\110 8086,SM reg32|64,imm \320\10\xB8\35 386,SD rm32|64,imm \300\320\1\xC7\200\41 386,SD @@ -2025,7 +2026,7 @@ void \2\x0F\x07 P6,PRIV,AMD regmem,reg16|32|64 \300\320\1\x85\101 8086,SM reg16|32|64,mem \301\320\1\x85\110 8086,SM reg8,reg8 \300\323\1\x84\101 8086 -rm8,reg8 \301\323\1\x84\110 8086,SM +rm8,reg8 \301\323\1\x84\101 8086,SM reg_eax,imm \325\1\xA9\41 386,SM reg_ax,imm \324\1\xA9\31 8086,SM reg_al,imm \1\xA8\21 8086,SM diff --git a/compiler/x86_64/x8664tab.inc b/compiler/x86_64/x8664tab.inc index aec20ddffd..4aa0bdcf55 100644 --- a/compiler/x86_64/x8664tab.inc +++ b/compiler/x86_64/x8664tab.inc @@ -6290,7 +6290,7 @@ opcode : A_TEST; ops : 2; optypes : (ot_regmem or ot_bits8,ot_reg8,ot_none); - code : #193#211#1#132#72; + code : #193#211#1#132#65; flags : if_8086 or if_sm ), ( diff --git a/tests/webtbs/tw11786.pp b/tests/webtbs/tw11786.pp new file mode 100644 index 0000000000..55b8cd270c --- /dev/null +++ b/tests/webtbs/tw11786.pp @@ -0,0 +1,25 @@ +{ %cpu=i386 } +var + w : word; + b1,b2,b3 : byte; +begin + b1:=$aa; + b2:=$55; + b3:=$aa; +{$asmmode intel} + asm + mov eax,$deadbeef + mov ax,w + shr eax,16 + mov w,ax + mov bl,$55 + lea edx,b2 + test [edx],bl + setnz b1 + end; + if w<>$dead then + halt(1); + if b1<>1 then + halt(1); + writeln('ok'); +end.