* 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:
nickysn 2017-10-25 19:38:37 +00:00
parent 07eab50afe
commit 8a0d8f025b
4 changed files with 72 additions and 2 deletions

2
.gitattributes vendored
View File

@ -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/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_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/tfarcal1.pp svneol=native#text/pascal
tests/test/cpu16/i8086/tfarcal2.pp svneol=native#text/pascal

View File

@ -1426,10 +1426,12 @@ implementation
) then
message(asmr_e_invalid_opcode_and_operand);
if
{$ifndef i8086}
{$ifdef i8086}
(longint(val)>=-128) and (val<=127) then
{$else i8086}
(opsize<>S_W) and
{$endif not i8086}
(aint(val)>=-128) and (val<=127) then
{$endif not i8086}
ot:=OT_IMM8 or OT_SIGNED
else
ot:=OT_IMMEDIATE or opsize_2_type[i,opsize];

View 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.

View 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.