Category : Files from Magazines
Archive   : MAY91.ZIP
Filename : 2N05021A

 
Output of file : 2N05021A contained in archive : MAY91.ZIP
program byteFlip;

var
theTime: longint; (* keep time in 60ths of a second *)
value: longint;
i: integer;

(* Here is a crude high-level language function to change
byte order *)
(* no effort at optimization has been taken *)
function FlipOrder (n: longint): longint;
var
result: longint;
begin
FlipOrder := BSL(BAND(n, $000000FF), 24) + BAND(BSL(n, 8),
$00FF0000) +
BitAnd(BSR(n, 8), $0000FF00) + BitAnd(BSR(n, 24), $000000FF);
end;

begin
ShowText;

value := $01020304;
theTime := TickCount;

for i := 0 to 9999 do
begin
value := FlipOrder(value);
end;

theTime := TickCount - theTime;
writeln('Time per flip =', (theTime / 60.0) / 10000.0 : 12 : 6);
readln;

end.



  3 Responses to “Category : Files from Magazines
Archive   : MAY91.ZIP
Filename : 2N05021A

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/