FireBirdLib - Topfield TMS PVR TAP Programming Library
DumpMemoryDword.c
Go to the documentation of this file.
1#include <stdio.h>
2#include <string.h>
3#include "libFireBird.h"
4
5void DumpMemoryDword(dword *p, dword size)
6{
8
9 dword *StartAddress = p;
10 int CollectedBytes;
11 char Header[20];
12 char s[255];
13 int Remaining;
14
15 if(!p)
16 {
17 TAP_Print("0x00000000 NULL\n");
18
19 TRACEEXIT();
20 return;
21 }
22
23 s[0] = '\0';
24 CollectedBytes = 0;
25
26 TAP_SPrint(Header, "%p 0x%4.4lx: ", p, (dword)p - (dword)StartAddress);
27
28 Remaining = size;
29 while(Remaining > 0)
30 {
31 TAP_SPrint(&s[strlen(s)], "%8.8x ", *p);
32
33 CollectedBytes += 4;
34 p++;
35 Remaining -= 4;
36
37 if(CollectedBytes >= 16)
38 {
39 strcat(s, "\n");
40 TAP_Print(Header);
41 TAP_Print(s);
42 s[0] = '\0';
43 TAP_SPrint(Header, "%p 0x%4.4lx: ", p, (dword)p - (dword)StartAddress);
44 CollectedBytes = 0;
45 }
46 }
47
48 if(strlen(s))
49 {
50 strcat(s, "\n");
51 TAP_Print(Header);
52 TAP_Print(s);
53 }
54
55 TRACEEXIT();
56}
void DumpMemoryDword(dword *p, dword size)
#define TAP_Print
Definition: libFireBird.h:181
#define TRACEEXIT()
Definition: libFireBird.h:1244
#define TRACEENTER()
Definition: libFireBird.h:1243