+ added the 'Cannot override ES' message in the at&t assembler reader as well

git-svn-id: trunk@37456 -
This commit is contained in:
nickysn 2017-10-14 00:48:46 +00:00
parent 27978de111
commit dd9b5eb2aa
7 changed files with 111 additions and 0 deletions

5
.gitattributes vendored
View File

@ -12393,6 +12393,11 @@ tests/test/tasm13b.pp svneol=native#text/plain
tests/test/tasm13c.pp svneol=native#text/plain
tests/test/tasm13d.pp svneol=native#text/plain
tests/test/tasm13e.pp svneol=native#text/plain
tests/test/tasm13f.pp svneol=native#text/plain
tests/test/tasm13g.pp svneol=native#text/plain
tests/test/tasm13h.pp svneol=native#text/plain
tests/test/tasm13i.pp svneol=native#text/plain
tests/test/tasm13j.pp svneol=native#text/plain
tests/test/tasm2.inc svneol=native#text/plain
tests/test/tasm2.pp svneol=native#text/plain
tests/test/tasm2a.pp svneol=native#text/plain

View File

@ -786,6 +786,7 @@ Implementation
var
operandnum : longint;
PrefixOp,OverrideOp: tasmop;
di_param: ShortInt;
Begin
PrefixOp:=A_None;
OverrideOp:=A_None;
@ -897,6 +898,21 @@ Implementation
opcode:=x86_param2paramless_string_op(opcode);
end;
end;
{ Check for invalid ES: overrides }
if is_x86_parameterized_string_op(instr.opcode) then
begin
di_param:=get_x86_string_op_di_param(instr.opcode);
if di_param<>-1 then
begin
di_param:=x86_parameterized_string_op_param_count(instr.opcode)-di_param;
if di_param<=operandnum then
with instr.operands[di_param] do
if (opr.typ=OPR_REFERENCE) and
(opr.ref.segment<>NR_NO) and
(opr.ref.segment<>NR_ES) then
Message(asmr_e_cannot_override_es_segment);
end;
end;
end;

18
tests/test/tasm13f.pp Normal file
View File

@ -0,0 +1,18 @@
{ %CPU=i8086,i386,x86_64 }
{ %fail }
{ Tests the 'Cannot override ES segment' error message }
{$asmmode att}
begin
asm
{$if defined(cpui8086)}
movsb (%si), %ds:(%di)
{$elseif defined(cpui386)}
movsb (%esi), %ds:(%edi)
{$elseif defined(cpux86_64)}
movsb (%rsi), %fs:(%rdi)
{$endif}
end;
end.

18
tests/test/tasm13g.pp Normal file
View File

@ -0,0 +1,18 @@
{ %CPU=i8086,i386,x86_64 }
{ %fail }
{ Tests the 'Cannot override ES segment' error message }
{$asmmode att}
begin
asm
{$if defined(cpui8086)}
cmpsb %ds:(%di), (%si)
{$elseif defined(cpui386)}
cmpsb %ds:(%edi), (%esi)
{$elseif defined(cpux86_64)}
cmpsb %fs:(%rdi), (%rsi)
{$endif}
end;
end.

18
tests/test/tasm13h.pp Normal file
View File

@ -0,0 +1,18 @@
{ %CPU=i8086,i386,x86_64 }
{ %fail }
{ Tests the 'Cannot override ES segment' error message }
{$asmmode att}
begin
asm
{$if defined(cpui8086)}
scasb %ds:(%di)
{$elseif defined(cpui386)}
scasb %ds:(%edi)
{$elseif defined(cpux86_64)}
scasb %fs:(%rdi)
{$endif}
end;
end.

18
tests/test/tasm13i.pp Normal file
View File

@ -0,0 +1,18 @@
{ %CPU=i8086,i386,x86_64 }
{ %fail }
{ Tests the 'Cannot override ES segment' error message }
{$asmmode att}
begin
asm
{$if defined(cpui8086)}
stosb %ds:(%di)
{$elseif defined(cpui386)}
stosb %ds:(%edi)
{$elseif defined(cpux86_64)}
stosb %fs:(%rdi)
{$endif}
end;
end.

18
tests/test/tasm13j.pp Normal file
View File

@ -0,0 +1,18 @@
{ %CPU=i8086,i386,x86_64 }
{ %fail }
{ Tests the 'Cannot override ES segment' error message }
{$asmmode att}
begin
asm
{$if defined(cpui8086)}
insb %dx,%ds:(%di)
{$elseif defined(cpui386)}
insb %dx,%ds:(%edi)
{$elseif defined(cpux86_64)}
insb %dx,%fs:(%rdi)
{$endif}
end;
end.