mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-26 15:10:12 +02:00
* fixed another i8086 inline asm 32-bit constant bug (e.g. in 'or eax, 80000001h')
git-svn-id: trunk@37521 -
This commit is contained in:
parent
07eab50afe
commit
8a0d8f025b
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -12107,6 +12107,8 @@ tests/test/cg/variants/tvarol94.pp svneol=native#text/plain
|
|||||||
tests/test/cg/variants/tvarol96.pp svneol=native#text/plain
|
tests/test/cg/variants/tvarol96.pp svneol=native#text/plain
|
||||||
tests/test/cpu16/i8086/tasm16_32_1.pp svneol=native#text/pascal
|
tests/test/cpu16/i8086/tasm16_32_1.pp svneol=native#text/pascal
|
||||||
tests/test/cpu16/i8086/tasm16_32_2.pp svneol=native#text/pascal
|
tests/test/cpu16/i8086/tasm16_32_2.pp svneol=native#text/pascal
|
||||||
|
tests/test/cpu16/i8086/tasm16_32_3.pp svneol=native#text/pascal
|
||||||
|
tests/test/cpu16/i8086/tasm16_32_4.pp svneol=native#text/pascal
|
||||||
tests/test/cpu16/i8086/tasmseg1.pp svneol=native#text/pascal
|
tests/test/cpu16/i8086/tasmseg1.pp svneol=native#text/pascal
|
||||||
tests/test/cpu16/i8086/tfarcal1.pp svneol=native#text/pascal
|
tests/test/cpu16/i8086/tfarcal1.pp svneol=native#text/pascal
|
||||||
tests/test/cpu16/i8086/tfarcal2.pp svneol=native#text/pascal
|
tests/test/cpu16/i8086/tfarcal2.pp svneol=native#text/pascal
|
||||||
|
@ -1426,10 +1426,12 @@ implementation
|
|||||||
) then
|
) then
|
||||||
message(asmr_e_invalid_opcode_and_operand);
|
message(asmr_e_invalid_opcode_and_operand);
|
||||||
if
|
if
|
||||||
{$ifndef i8086}
|
{$ifdef i8086}
|
||||||
|
(longint(val)>=-128) and (val<=127) then
|
||||||
|
{$else i8086}
|
||||||
(opsize<>S_W) and
|
(opsize<>S_W) and
|
||||||
{$endif not i8086}
|
|
||||||
(aint(val)>=-128) and (val<=127) then
|
(aint(val)>=-128) and (val<=127) then
|
||||||
|
{$endif not i8086}
|
||||||
ot:=OT_IMM8 or OT_SIGNED
|
ot:=OT_IMM8 or OT_SIGNED
|
||||||
else
|
else
|
||||||
ot:=OT_IMMEDIATE or opsize_2_type[i,opsize];
|
ot:=OT_IMMEDIATE or opsize_2_type[i,opsize];
|
||||||
|
33
tests/test/cpu16/i8086/tasm16_32_3.pp
Normal file
33
tests/test/cpu16/i8086/tasm16_32_3.pp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{ %cpu=i8086 }
|
||||||
|
|
||||||
|
{ i8086 test for correct assembly of 32-bit instructions on the i8086 target }
|
||||||
|
|
||||||
|
{ this one tests an instruction with a 32-bit const operand }
|
||||||
|
|
||||||
|
program tasm16_32_3;
|
||||||
|
|
||||||
|
{$asmmode intel}
|
||||||
|
{$asmcpu 80386}
|
||||||
|
|
||||||
|
var
|
||||||
|
lo_word, hi_word: Word;
|
||||||
|
begin
|
||||||
|
asm
|
||||||
|
db 66h, 31h, 0c0h { xor eax, eax }
|
||||||
|
|
||||||
|
{ the actual instruction being tested: }
|
||||||
|
or eax, 80000001h
|
||||||
|
|
||||||
|
db 66h, 50h { push eax }
|
||||||
|
|
||||||
|
pop word ptr [lo_word]
|
||||||
|
pop word ptr [hi_word]
|
||||||
|
end;
|
||||||
|
if (lo_word=$0001) and (hi_word=$8000) then
|
||||||
|
Writeln('Ok!')
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Writeln('Error!');
|
||||||
|
Halt(1);
|
||||||
|
end;
|
||||||
|
end.
|
33
tests/test/cpu16/i8086/tasm16_32_4.pp
Normal file
33
tests/test/cpu16/i8086/tasm16_32_4.pp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{ %cpu=i8086 }
|
||||||
|
|
||||||
|
{ i8086 test for correct assembly of 32-bit instructions on the i8086 target }
|
||||||
|
|
||||||
|
{ this one tests an instruction with a 32-bit const operand }
|
||||||
|
|
||||||
|
program tasm16_32_4;
|
||||||
|
|
||||||
|
{$asmmode att}
|
||||||
|
{$asmcpu 80386}
|
||||||
|
|
||||||
|
var
|
||||||
|
lo_word, hi_word: Word;
|
||||||
|
begin
|
||||||
|
asm
|
||||||
|
.byte 0x66, 0x31, 0xc0 { xor eax, eax }
|
||||||
|
|
||||||
|
{ the actual instruction being tested: }
|
||||||
|
orl $0x80000001, %eax
|
||||||
|
|
||||||
|
.byte 0x66, 0x50 { push eax }
|
||||||
|
|
||||||
|
popw lo_word
|
||||||
|
popw hi_word
|
||||||
|
end;
|
||||||
|
if (lo_word=$0001) and (hi_word=$8000) then
|
||||||
|
Writeln('Ok!')
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Writeln('Error!');
|
||||||
|
Halt(1);
|
||||||
|
end;
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user