HexDump Function

Requires: gfawinx.lg32

Purpose

A debugging aid to show the contents of a piece of memory.

Syntax

str = HexDump(addr [, len])

str: string variable
addr, len: integer expressions

Description

HexDump returns a string with a memory dump of at least 16 bytes formatted as hexadecimal numbers. The size of the memory dump can be determined using the optional second argument len but is always rounded to a multiple of 16. Debug.Print or any other output command can be used to display the string.

Example

$Library "gfawinx"

Local String a, w

a = "Hello GFABASIC32"

w = Wide(a)

Debug HexDump(V:w, Len(w))

a = Ansi(w)

Debug HexDump(V:a, Len(a))

Debug.Show

The above example outputs the following memory dump to the debug output window:

02A440F4: 48 00 65 00 6C 00 6C 00 6F 00 20 00 47 00 46 00 H.e.l.l. o. .G.F.
02A44104: 41 00 42 00 41 00 53 00 49 00 43 00 33 00 32 00 A.B.A.S. I.C.3.2.
02A44114: 00 00 00 00 00 00 00 61 72 79 5C 4E 6F 4E 61 6D .......a ry\NoNam
 
0264CD44: 48 65 6C 6C 6F 20 47 46 41 42 41 53 49 43 33 32 Hello GF ABASIC32

Remarks

HexDump uses the DisAsm object to create a string with a hex dump.

See Also

Ansi, Debug, DisAsm, Wide

{Created by Sjouke Hamstra; Last updated: 13/08/2019 by James Gaite}