mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 20:40:24 +02:00
* x86: New debug_hexstr instruction to help produce concise debug comments
This commit is contained in:
parent
6e84ee5806
commit
ae47cc2c88
@ -1224,6 +1224,23 @@ unit aoptx86;
|
||||
Result := tostr(i);
|
||||
end;
|
||||
|
||||
function debug_hexstr(i: tcgint): string;
|
||||
begin
|
||||
Result := '0x';
|
||||
case i of
|
||||
0..$FF:
|
||||
Result := Result + hexstr(i, 2);
|
||||
$100..$FFFF:
|
||||
Result := Result + hexstr(i, 4);
|
||||
$10000..$FFFFFF:
|
||||
Result := Result + hexstr(i, 6);
|
||||
$1000000..$FFFFFFFF:
|
||||
Result := Result + hexstr(i, 8);
|
||||
else
|
||||
Result := Result + hexstr(i, 16);
|
||||
end;
|
||||
end;
|
||||
|
||||
function debug_regname(r: TRegister): string; inline;
|
||||
begin
|
||||
Result := '%' + std_regname(r);
|
||||
@ -1284,6 +1301,11 @@ unit aoptx86;
|
||||
Result := '';
|
||||
end;
|
||||
|
||||
function debug_hexstr(i: tcgint): string; inline;
|
||||
begin
|
||||
Result := '';
|
||||
end;
|
||||
|
||||
function debug_regname(r: TRegister): string; inline;
|
||||
begin
|
||||
Result := '';
|
||||
|
Loading…
Reference in New Issue
Block a user