mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-08 04:25:59 +02:00
+ added the 'Cannot override ES' message in the at&t assembler reader as well
git-svn-id: trunk@37456 -
This commit is contained in:
parent
27978de111
commit
dd9b5eb2aa
5
.gitattributes
vendored
5
.gitattributes
vendored
@ -12393,6 +12393,11 @@ tests/test/tasm13b.pp svneol=native#text/plain
|
|||||||
tests/test/tasm13c.pp svneol=native#text/plain
|
tests/test/tasm13c.pp svneol=native#text/plain
|
||||||
tests/test/tasm13d.pp svneol=native#text/plain
|
tests/test/tasm13d.pp svneol=native#text/plain
|
||||||
tests/test/tasm13e.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.inc svneol=native#text/plain
|
||||||
tests/test/tasm2.pp svneol=native#text/plain
|
tests/test/tasm2.pp svneol=native#text/plain
|
||||||
tests/test/tasm2a.pp svneol=native#text/plain
|
tests/test/tasm2a.pp svneol=native#text/plain
|
||||||
|
@ -786,6 +786,7 @@ Implementation
|
|||||||
var
|
var
|
||||||
operandnum : longint;
|
operandnum : longint;
|
||||||
PrefixOp,OverrideOp: tasmop;
|
PrefixOp,OverrideOp: tasmop;
|
||||||
|
di_param: ShortInt;
|
||||||
Begin
|
Begin
|
||||||
PrefixOp:=A_None;
|
PrefixOp:=A_None;
|
||||||
OverrideOp:=A_None;
|
OverrideOp:=A_None;
|
||||||
@ -897,6 +898,21 @@ Implementation
|
|||||||
opcode:=x86_param2paramless_string_op(opcode);
|
opcode:=x86_param2paramless_string_op(opcode);
|
||||||
end;
|
end;
|
||||||
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;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
18
tests/test/tasm13f.pp
Normal file
18
tests/test/tasm13f.pp
Normal 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
18
tests/test/tasm13g.pp
Normal 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
18
tests/test/tasm13h.pp
Normal 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
18
tests/test/tasm13i.pp
Normal 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
18
tests/test/tasm13j.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user