mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-02-04 04:55:01 +01:00
+ support LEA with 16-bit operand size
git-svn-id: trunk@25808 -
This commit is contained in:
parent
8dd956cbde
commit
4aa010eedc
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11430,6 +11430,7 @@ tests/test/tisoread.pp svneol=native#text/pascal
|
||||
tests/test/tisorec1.pp svneol=native#text/pascal
|
||||
tests/test/tisorec2.pp svneol=native#text/pascal
|
||||
tests/test/tisorec3.pp svneol=native#text/pascal
|
||||
tests/test/tlea1.pp svneol=native#text/plain
|
||||
tests/test/tlib1a.pp svneol=native#text/plain
|
||||
tests/test/tlib1b.pp svneol=native#text/plain
|
||||
tests/test/tlib2a.pp svneol=native#text/plain
|
||||
|
||||
@ -2649,14 +2649,14 @@
|
||||
(
|
||||
opcode : A_LEA;
|
||||
ops : 2;
|
||||
optypes : (ot_reg32 or ot_bits64,ot_memory,ot_none,ot_none);
|
||||
optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_memory,ot_none,ot_none);
|
||||
code : #208#1#141#72;
|
||||
flags : if_8086
|
||||
),
|
||||
(
|
||||
opcode : A_LEA;
|
||||
ops : 2;
|
||||
optypes : (ot_reg32 or ot_bits64,ot_immediate,ot_none,ot_none);
|
||||
optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_immediate,ot_none,ot_none);
|
||||
code : #208#1#141#72;
|
||||
flags : if_8086 or if_sd
|
||||
),
|
||||
|
||||
@ -2649,14 +2649,14 @@
|
||||
(
|
||||
opcode : A_LEA;
|
||||
ops : 2;
|
||||
optypes : (ot_reg32 or ot_bits64,ot_memory,ot_none,ot_none);
|
||||
optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_memory,ot_none,ot_none);
|
||||
code : #208#1#141#72;
|
||||
flags : if_8086
|
||||
),
|
||||
(
|
||||
opcode : A_LEA;
|
||||
ops : 2;
|
||||
optypes : (ot_reg32 or ot_bits64,ot_immediate,ot_none,ot_none);
|
||||
optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_immediate,ot_none,ot_none);
|
||||
code : #208#1#141#72;
|
||||
flags : if_8086 or if_sd
|
||||
),
|
||||
|
||||
@ -924,8 +924,8 @@ reg16|32,mem \320\1\xC5\110 8086,NOX86_64
|
||||
|
||||
[LEA,leaX]
|
||||
(Ch_Wop2, Ch_Rop1, Ch_None)
|
||||
reg32|64,mem \320\1\x8D\110 8086
|
||||
reg32|64,imm \320\1\x8D\110 8086,SD
|
||||
reg16|32|64,mem \320\1\x8D\110 8086
|
||||
reg16|32|64,imm \320\1\x8D\110 8086,SD
|
||||
|
||||
[LEAVE]
|
||||
(Ch_RWESP, Ch_WEBP, Ch_None)
|
||||
|
||||
@ -2544,14 +2544,14 @@
|
||||
(
|
||||
opcode : A_LEA;
|
||||
ops : 2;
|
||||
optypes : (ot_reg32 or ot_bits64,ot_memory,ot_none,ot_none);
|
||||
optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_memory,ot_none,ot_none);
|
||||
code : #208#1#141#72;
|
||||
flags : if_8086
|
||||
),
|
||||
(
|
||||
opcode : A_LEA;
|
||||
ops : 2;
|
||||
optypes : (ot_reg32 or ot_bits64,ot_immediate,ot_none,ot_none);
|
||||
optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_immediate,ot_none,ot_none);
|
||||
code : #208#1#141#72;
|
||||
flags : if_8086 or if_sd
|
||||
),
|
||||
|
||||
87
tests/test/tlea1.pp
Normal file
87
tests/test/tlea1.pp
Normal file
@ -0,0 +1,87 @@
|
||||
{ %cpu=i386 }
|
||||
|
||||
program tlea1;
|
||||
|
||||
{$ASMMODE intel}
|
||||
|
||||
procedure Fail;
|
||||
begin
|
||||
Writeln('Error!');
|
||||
Halt(1);
|
||||
end;
|
||||
|
||||
procedure TestO32A32;
|
||||
var
|
||||
res: DWord;
|
||||
begin
|
||||
Writeln('Testing LEA with 32-bit operand size and 32-bit address size...');
|
||||
asm
|
||||
mov ecx, 0deadbeefh
|
||||
mov edi, 0abcdefedh
|
||||
mov ebx, 055667788h
|
||||
lea ebx, [ecx + edi * 8 + 12345678h]
|
||||
mov res, ebx
|
||||
end ['EBX', 'ECX', 'EDI'];
|
||||
if res <> $4F5194CF then
|
||||
Fail;
|
||||
end;
|
||||
|
||||
procedure TestO16A32;
|
||||
var
|
||||
res: DWord;
|
||||
begin
|
||||
Writeln('Testing LEA with 16-bit operand size and 32-bit address size...');
|
||||
asm
|
||||
mov ecx, 0deadbeefh
|
||||
mov edi, 0abcdefedh
|
||||
mov ebx, 055667788h
|
||||
lea bx, [ecx + edi * 8 + 12345678h]
|
||||
mov res, ebx
|
||||
end ['EBX', 'ECX', 'EDI'];
|
||||
if res <> $556694CF then
|
||||
Fail;
|
||||
end;
|
||||
|
||||
{$ifdef 16BITADDRSUPPORT}
|
||||
procedure TestO32A16;
|
||||
var
|
||||
res: DWord;
|
||||
begin
|
||||
Writeln('Testing LEA with 32-bit operand size and 16-bit address size...');
|
||||
asm
|
||||
mov ebx, 0deadbeefh
|
||||
mov edi, 0abcdefedh
|
||||
mov ecx, 055667788h
|
||||
lea ecx, [bx + di + 1234h]
|
||||
mov res, ecx
|
||||
end ['EBX', 'ECX', 'EDI'];
|
||||
if res <> $C110 then
|
||||
Fail;
|
||||
end;
|
||||
|
||||
procedure TestO16A16;
|
||||
var
|
||||
res: DWord;
|
||||
begin
|
||||
Writeln('Testing LEA with 16-bit operand size and 16-bit address size...');
|
||||
asm
|
||||
mov ebx, 0deadbeefh
|
||||
mov edi, 0abcdefedh
|
||||
mov ecx, 055667788h
|
||||
lea cx, [bx + di + 1234h]
|
||||
mov res, ecx
|
||||
end ['EBX', 'ECX', 'EDI'];
|
||||
if res <> $5566C110 then
|
||||
Fail;
|
||||
end;
|
||||
{$endif 16BITADDRSUPPORT}
|
||||
|
||||
begin
|
||||
TestO32A32;
|
||||
TestO16A32;
|
||||
{$ifdef 16BITADDRSUPPORT}
|
||||
TestO32A16;
|
||||
TestO16A16;
|
||||
{$endif 16BITADDRSUPPORT}
|
||||
Writeln('Success!');
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user