* fixed the SEG inline asm directive when used with 32-bit registers on the i8086 target

git-svn-id: trunk@37613 -
This commit is contained in:
nickysn 2017-11-22 15:04:30 +00:00
parent 89da7ad63e
commit c464f7fa56
3 changed files with 61 additions and 1 deletions

1
.gitattributes vendored
View File

@ -12135,6 +12135,7 @@ tests/test/cpu16/i8086/tasmabs3.pp svneol=native#text/pascal
tests/test/cpu16/i8086/tasmabs4.pp svneol=native#text/pascal
tests/test/cpu16/i8086/tasmabs5.pp svneol=native#text/pascal
tests/test/cpu16/i8086/tasmseg1.pp svneol=native#text/pascal
tests/test/cpu16/i8086/tasmseg2.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/tfarcal3.pp svneol=native#text/plain

View File

@ -3355,7 +3355,11 @@ implementation
&40,&41,&42 : // 040..042
begin
getvalsym(c-&40);
if assigned(currsym) then
if assigned(currsym)
{$ifdef i8086}
or (currabsreloc in [RELOC_DGROUP,RELOC_FARDATASEG])
{$endif i8086}
then
objdata_writereloc(currval,4,currsym,currabsreloc32)
else
objdata.writebytes(currval,4);

View File

@ -0,0 +1,55 @@
{ %cpu=i8086 }
program tasmseg2;
{ i8086 test for the SEG inline assembler directive, when used in 32-bit
instructions }
{$asmmode intel}
{$asmcpu 80386}
var
err, err2, err3: Boolean;
begin
err := False;
asm
xor eax, eax
mov ebx, 0ffffffffh
mov ax, seg @data
mov ebx, seg @data
cmp eax, ebx
je @@ok
mov err, 1
@@ok:
end;
if err then
Writeln('32-bit and 16-bit seg @data don''t match!');
err2 := False;
asm
xor eax, eax
mov ebx, 0ffffffffh
mov ax, seg @code
mov ebx, seg @code
cmp eax, ebx
je @@ok2
mov err2, 1
@@ok2:
end;
if err2 then
Writeln('32-bit and 16-bit seg @code don''t match!');
err3 := False;
asm
xor eax, eax
mov ebx, 0ffffffffh
mov ax, seg err3
mov ebx, seg err3
cmp eax, ebx
je @@ok3
mov err3, 1
@@ok3:
end;
if err3 then
Writeln('32-bit and 16-bit seg err3 don''t match!');
if err or err2 or err3 then
Halt(1);
end.