{<<<< WriteHex >>>>}
{ From: COMPLETE TURBO PASCAL by Jeff Duntemann  }
{ Scott, Foresman & Co. 1986  ISBN 0-673-18600-8 }
{ Described in section 20.4 -- Last mod 2/1/86   }


PROCEDURE WriteHex(VAR Device : Text; BT : Byte);

CONST
  HexDigits : ARRAY[0..15] OF Char = '0123456789ABCDEF';

VAR
  BZ : Byte;

BEGIN
  BZ := BT AND $0F;
  BT := BT SHR 4;
  Write(Device,HexDigits[BT],HexDigits[BZ])
END;
