Initial check in
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
unit jtag.vme.tools;
|
||||
|
||||
interface
|
||||
|
||||
function FlipByte( Data: byte): byte;
|
||||
function FlipWord( Data: word): word;
|
||||
|
||||
implementation
|
||||
|
||||
function FlipByte( Data: byte): byte;
|
||||
var
|
||||
i: integer;
|
||||
|
||||
begin
|
||||
result := 0;
|
||||
|
||||
for i:=0 to 7 do
|
||||
begin
|
||||
result := result shl 1;
|
||||
|
||||
if Data and $01 = $01 then
|
||||
result := result or $1;
|
||||
|
||||
Data := Data shr 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
function FlipWord( Data: word): word;
|
||||
var
|
||||
i: integer;
|
||||
|
||||
begin
|
||||
result := 0;
|
||||
|
||||
for i:=0 to 15 do
|
||||
begin
|
||||
result := result shl 1;
|
||||
|
||||
if Data and $01 = $01 then
|
||||
result := result or $1;
|
||||
|
||||
Data := Data shr 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
Reference in New Issue
Block a user