1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?xml version='1.0' encoding='iso-8859-1'?>
- <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
- <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
- <head>
- <title>
- regview32.c
- </title>
- <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
- <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
- <meta name='author' content='cmaier@cmassoc.net'/>
- <meta name='robots' content='noindex,nofollow'/>
- <link href='toolkit.css' rel='stylesheet' type='text/css'/>
- </head>
- <body>
- <div class='headerlink'>
- [<a href='ReadRules.c.html' title=' ReadRules.c '>PREV</a>]
- [<a href='toolkit.html' title=' Index '>HOME</a>]
- [<a href='RemoteDeviceList1.c.html' title=' RemoteDeviceList1.c '>NEXT</a>]
- </div>
- <pre>
- /*====================================================================*
- *
- * void regview32 (void const * memory, size_t offset, size_t length, FILE *fp);
- *
- * memory.h
- *
- * print memory as a binary dump showing absolute memory offsets
- * and 32-bit binary register maps; sample output looks like:
- *
- * REGISTER CONTENTS 31----24 23----16 15----08 07----00
- *
- * 00183000 00000F7F 00000000-00000000-00001111-01111111
- * 00183004 00000A00 00000000-00000000-00001010-00000000
- * 00183008 00000FF8 00000000-00000000-00001111-11111000
- * 0018300C 00000000 00000000-00000000-00000000-00000000
- * 00183010 00000075 00000000-00000000-00000000-01110101
- *
- * the header line shown above is not part of the output;
- *
- * Motley Tools by Charles Maier <cmaier@cmassoc.net>;
- * Copyright (c) 2001-2006 by Charles Maier Associates;
- * Licensed under the Internet Software Consortium License;
- *
- *--------------------------------------------------------------------*/
- #ifndef REGVIEW_SOURCE
- #define REGVIEW_SOURCE
- #include <stdio.h>
- #include "../tools/memory.h"
- #include "../tools/endian.h"
- void regview32 (void const * memory, size_t offset, size_t extent, FILE *fp)
- {
- uint32_t * origin = (uint32_t *)(memory);
- while (extent >= sizeof (* origin))
- {
- signed bit = sizeof (* origin) << 3;
- printf ("%08X ", (uint32_t)(offset));
- printf ("%08X ", LE32TOH (* origin));
- while (bit--)
- {
- putc (((LE32TOH (* origin) >> bit) & 1)? '1': '0', fp);
- if ((bit) && !(bit%8))
- {
- putc ('-', fp);
- }
- }
- putc ('\n', fp);
- offset += sizeof (* origin);
- extent -= sizeof (* origin);
- origin++;
- }
- return;
- }
- #endif
- </pre>
- <div class='footerlink'>
- [<a href='ReadRules.c.html' title=' ReadRules.c '>PREV</a>]
- [<a href='toolkit.html' title=' Index '>HOME</a>]
- [<a href='RemoteDeviceList1.c.html' title=' RemoteDeviceList1.c '>NEXT</a>]
- </div>
- </body>
- </html>
|