mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-03 22:12:21 +02:00
* only check validity of assembler instructions in pass_2, after all
local operands have been resolved (mantis #8950) git-svn-id: trunk@7516 -
This commit is contained in:
parent
2b84a4643a
commit
8bcb6e689d
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8270,6 +8270,7 @@ tests/webtbs/tw8861.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8870.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8883.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8919.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8950.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8975.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8975a.pp svneol=native#text/plain
|
||||
tests/webtbs/ub1873.pp svneol=native#text/plain
|
||||
|
@ -268,8 +268,13 @@ interface
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
{$ifdef x86}
|
||||
{ can only be checked now that all local operands }
|
||||
{ have been resolved }
|
||||
taicpu(hp2).CheckIfValid;
|
||||
{$endif x86}
|
||||
end;
|
||||
ait_marker :
|
||||
ait_marker :
|
||||
begin
|
||||
{ it's not an assembler block anymore }
|
||||
if (tai_marker(hp2).kind in [mark_AsmBlockStart, mark_AsmBlockEnd]) then
|
||||
@ -303,6 +308,11 @@ interface
|
||||
{ fixup the references }
|
||||
for i:=1 to taicpu(hp).ops do
|
||||
ResolveRef(taicpu(hp).oper[i-1]^);
|
||||
{$ifdef x86}
|
||||
{ can only be checked now that all local operands }
|
||||
{ have been resolved }
|
||||
taicpu(hp).CheckIfValid;
|
||||
{$endif x86}
|
||||
end;
|
||||
end;
|
||||
hp:=tai(hp.next);
|
||||
|
@ -744,11 +744,7 @@ begin
|
||||
|
||||
{ Concat the opcode or give an error }
|
||||
if assigned(ai) then
|
||||
begin
|
||||
{ Check the instruction if it's valid }
|
||||
ai.CheckIfValid;
|
||||
p.concat(ai);
|
||||
end
|
||||
p.concat(ai)
|
||||
else
|
||||
Message(asmr_e_invalid_opcode_and_operand);
|
||||
result:=ai;
|
||||
|
19
tests/webtbs/tw8950.pp
Normal file
19
tests/webtbs/tw8950.pp
Normal file
@ -0,0 +1,19 @@
|
||||
{ %cpu=i386,x86_64 }
|
||||
|
||||
{$ifdef fpc}
|
||||
{$mode delphi}
|
||||
{$endif}
|
||||
|
||||
procedure SetBitBuffer(var Value; const Bit: Cardinal);
|
||||
asm
|
||||
BTS [Value], Bit
|
||||
end;
|
||||
|
||||
var
|
||||
l: longint;
|
||||
begin
|
||||
l := 0;
|
||||
setbitbuffer(l,5);
|
||||
if (l <> 32) then
|
||||
halt(1);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user