mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 15:47:51 +02:00
* take into account the address size in lnfodwrf.ReadAddress on i8086; support
2-byte and 4-byte addresses git-svn-id: trunk@39060 -
This commit is contained in:
parent
a7f5a69000
commit
3989e57fed
@ -470,19 +470,31 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{$ifdef CPUI8086}
|
||||||
{ Reads an address from the current input stream }
|
{ Reads an address from the current input stream }
|
||||||
function ReadAddress(addr_size: smallint) : PtrUInt;
|
function ReadAddress(addr_size: smallint) : LongWord;
|
||||||
begin
|
begin
|
||||||
ReadNext(ReadAddress, sizeof(ReadAddress));
|
if addr_size = 4 then
|
||||||
|
ReadNext(ReadAddress, 4)
|
||||||
|
else if addr_size = 2 then begin
|
||||||
|
ReadAddress := 0;
|
||||||
|
ReadNext(ReadAddress, 2);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
ReadAddress := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{$ifdef CPUI8086}
|
|
||||||
{ Reads a segment from the current input stream }
|
{ Reads a segment from the current input stream }
|
||||||
function ReadSegment() : Word;
|
function ReadSegment() : Word;
|
||||||
begin
|
begin
|
||||||
ReadNext(ReadSegment, sizeof(ReadSegment));
|
ReadNext(ReadSegment, sizeof(ReadSegment));
|
||||||
end;
|
end;
|
||||||
|
{$else CPUI8086}
|
||||||
|
{ Reads an address from the current input stream }
|
||||||
|
function ReadAddress(addr_size: smallint) : PtrUInt;
|
||||||
|
begin
|
||||||
|
ReadNext(ReadAddress, sizeof(ReadAddress));
|
||||||
|
end;
|
||||||
{$endif CPUI8086}
|
{$endif CPUI8086}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user