From 39a2fa1dffd100f893f71899dd346c76b6426b04 Mon Sep 17 00:00:00 2001 From: Eric Smith Date: Wed, 2 Jan 2002 16:39:20 +0000 Subject: [PATCH] Initial revision --- br.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 br.c diff --git a/br.c b/br.c new file mode 100644 index 0000000..62a4ab0 --- /dev/null +++ b/br.c @@ -0,0 +1,31 @@ +#include + +int main (int argc, char *argv[]) +{ + int i, j; + + printf ("static const u8 bit_reverse_byte [0x100] =\n"); + printf ("{\n"); + for (i = 0; i < 0x100; i++) + { + if ((i & 7) == 0) + printf (" "); + j = (((i & 0x01) << 7) | + ((i & 0x02) << 5) | + ((i & 0x04) << 3) | + ((i & 0x08) << 1) | + ((i & 0x10) >> 1) | + ((i & 0x20) >> 3) | + ((i & 0x40) >> 5) | + ((i & 0x80) >> 7)); + printf ("0x%02x", j); + if (i != 0xff) + printf (","); + if ((i & 7) == 7) + printf ("\n"); + else + printf (" "); + } + printf ("};\n"); + return (0); +}