* x86: New debug_hexstr instruction to help produce concise debug comments

This commit is contained in:
J. Gareth "Curious Kit" Moreton 2023-02-02 15:48:14 +00:00 committed by FPK
parent 6e84ee5806
commit ae47cc2c88

View File

@ -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 := '';