DEFINITION MODULE HexData;

        (********************************************************)
        (*                                                      *)
        (*   Misc procedures for dealing with arrays of bytes   *)
        (*                                                      *)
        (*  Programmer:         P. Moylan                       *)
        (*  Started:            30 October 2017                 *)
        (*  Last edited:        28 March 2018                   *)
        (*  Status:             OK                              *)
        (*                                                      *)
        (********************************************************)


FROM SYSTEM IMPORT (* type *) CARD8, CARD32;


PROCEDURE HexToBytes (str: ARRAY OF CHAR;
                            VAR (*OUT*) A: ARRAY OF CARD8): CARDINAL;

    (* Converts string of 2-digit hex numbers.  Returns number of bytes. *)

PROCEDURE DumpByte (b: CARD8);

    (* Writes word in bigendian hex notation. *)

PROCEDURE DumpByteArray (N: CARDINAL;  B: ARRAY OF CARD8);

    (* Writes N bytes in hex notation. *)

PROCEDURE DumpWord (w: CARD32);

    (* Writes w in hexadecimal. *)

END HexData.

