summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2009-08-30 16:12:41 +0000
committerMatt Turner <mattst88@gmail.com>2009-08-30 16:12:41 +0000
commite1ac89f2a2e4cfd2e31eac41575f318d3e0f74be (patch)
tree1ba1a8bbe02bb450f4e045ca625d7bf2612967f0 /src
parentd47db4643ba5aba34c9bdebb249d55a98c860950 (diff)
Add test suite for determine_slotting.cHEADmaster
git-svn-id: svn://mattst88.com/svn/annotator/trunk@6 b9d43f0c-d947-41e4-9d27-581b740e5c48
Diffstat (limited to 'src')
-rw-r--r--src/alpha-dis.c2
-rw-r--r--src/determine_slotting.c77
2 files changed, 1 insertions, 78 deletions
diff --git a/src/alpha-dis.c b/src/alpha-dis.c
index 8b7a6fa..72e70e4 100644
--- a/src/alpha-dis.c
+++ b/src/alpha-dis.c
@@ -109,7 +109,7 @@ print_insn_alpha (memaddr, info)
(*info->memory_error_func) (status, memaddr, info);
return -1;
}
- insn = bfd_getl32 (buffer);
+ memcpy(&insn, buffer, 4);
}
/* Get the major opcode of the instruction. */
diff --git a/src/determine_slotting.c b/src/determine_slotting.c
index 32d6927..d79162b 100644
--- a/src/determine_slotting.c
+++ b/src/determine_slotting.c
@@ -7,62 +7,6 @@
#define CLUSTER_0 0
#define CLUSTER_1 1
-#if defined DEBUG && DEBUG == 1
-
-#include <stdio.h>
-
-#define PRINT_DEBUG printf("%c%c%c%c\n", octaword.instr[3].slot, octaword.instr[2].slot, octaword.instr[1].slot, octaword.instr[0].slot)
-
-#define RULE1() \
- octaword.instr[3].slot = 'U'; \
- octaword.instr[2].slot = 'U'; \
- octaword.instr[1].slot = 'U'; \
- octaword.instr[0].slot = 'U'
-
-#define RULE2() \
- octaword.instr[3].slot = 'E'; \
- octaword.instr[2].slot = 'U'; \
- octaword.instr[1].slot = 'U'; \
- octaword.instr[0].slot = 'U'
-
-#define RULE3() \
- octaword.instr[3].slot = 'U'; \
- octaword.instr[2].slot = 'U'; \
- octaword.instr[1].slot = 'E'; \
- octaword.instr[0].slot = 'L'
-
-#define RULE3B() \
- octaword.instr[3].slot = 'E'; \
- octaword.instr[2].slot = 'E'; \
- octaword.instr[1].slot = 'L'; \
- octaword.instr[0].slot = 'L'
-
-#define RULE4C() \
- octaword.instr[3].slot = 'E'; \
- octaword.instr[2].slot = 'E'; \
- octaword.instr[1].slot = 'E'; \
- octaword.instr[0].slot = 'U'
-
-#define RULE4A() \
- octaword.instr[3].slot = 'E'; \
- octaword.instr[2].slot = 'L'; \
- octaword.instr[1].slot = 'E'; \
- octaword.instr[0].slot = 'U'
-
-#define RULE4AD() \
- octaword.instr[3].slot = 'U'; \
- octaword.instr[2].slot = 'L'; \
- octaword.instr[1].slot = 'E'; \
- octaword.instr[0].slot = 'E'
-
-#define RULE4CD() \
- octaword.instr[3].slot = 'E'; \
- octaword.instr[2].slot = 'E'; \
- octaword.instr[1].slot = 'E'; \
- octaword.instr[0].slot = 'E'
-
-#endif /* DEBUG */
-
struct octaword_t
{
struct {
@@ -236,24 +180,3 @@ determine_slotting(struct octaword_t octaword)
return octaword;
}
-
-#if defined DEBUG && DEBUG == 1
-int main() {
- struct octaword_t octaword;
-
-// RULE3();
-// RULE3B();
-// RULE4C();
- RULE4A();
-// RULE4AD();
-// RULE4CD();
-
- PRINT_DEBUG;
-
- octaword = determine_slotting(octaword);
-
- PRINT_DEBUG;
-
- return 0;
-}
-#endif