This commit is contained in:
Thaddeus-Maximus
2026-04-03 15:58:58 -05:00
commit f3953d66ae
1516 changed files with 586639 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
procedure HexPrint(theData : longint; nibbles : byte);
var
shiftCount : integer;
const
hexChars : array[0..15] of char = ('0','1','2','3','4','5','6','7',
'8','9','A','B','C','D','E','F');
begin
shiftCount := (nibbles * 4) -4;
while shiftCount >= 0 do
begin
write(hexChars[((thedata shr shiftCount) and $000F)]);
shiftCount := shiftCount - 4;
end;
end;
function HexString(theData : longint; nibbles : byte) : string;
var
shiftCount : integer;
s : string;
const
hexChars : array[0..15] of char = ('0','1','2','3','4','5','6','7',
'8','9','A','B','C','D','E','F');
begin
s := '';
shiftCount := (nibbles * 4) -4;
while shiftCount >= 0 do
begin
s:=s+(hexChars[((thedata shr shiftCount) and $000F)]);
shiftCount := shiftCount - 4;
end;
HexString := s;
end;