mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 04:59:26 +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;
|
||||
|
||||
|
||||
{$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}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user