* 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:
nickysn 2018-05-20 15:48:58 +00:00
parent a7f5a69000
commit 3989e57fed

View File

@ -470,19 +470,31 @@ begin
end;
{$ifdef CPUI8086}
{ Reads an address from the current input stream }
function ReadAddress(addr_size: smallint) : PtrUInt;
function ReadAddress(addr_size: smallint) : LongWord;
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;
{$ifdef CPUI8086}
{ Reads a segment from the current input stream }
function ReadSegment() : Word;
begin
ReadNext(ReadSegment, sizeof(ReadSegment));
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}